I was wondering if there is an existing control that I could use to achieve what I am trying.
Basically, I have a html table that I display my header information.
It looks something like this:
<table class='tableEdit'> <tr> <th>Job ID</th><td>10</td> <th>Client</th><td>Tom</td> </tr> <tr> <th>Comments</th><td>Comments are here</td> </tr> </table>
I am wondering if there is an existing control that I can use as a container. Then I can assign the datasource to that control and leverage the field values as such.
<asp:Somecontrol runat='server' ID='someid'> <table class='tableEdit'> <tr> <th>Job ID</th><td><%# Eval('Id') %></td> <th>Client</th><td><%# Eval('Client.Name') %></td> </tr> <tr> <th>Comments</th><td><%# Eval('Comments') %></td> </tr> </table> </asp:Somecontrol> private void BindHeader() { SomeObjectType data = DAL.SomeMethod(); someid.Datasource = data; someid.DataBind(); }
Is there anything out there to do this? I want to be able to control the layout of the fields within the container.
Thanks.
Actually what i was after was the FormView control.
I had never used this control previously, but this is the exact control for what i wanted to do.
It allows to to mark a region, assign a datasource and bind items as desired.
Thanks AI W for your input. Repeater is also suitable but for binding ‘a’ record, FormView is ideal i think. Thanks.