Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_beginners thread: UserControl


Message #1 by "Datatal AB - Gauffin, Jonas" <Jonas@d...> on Wed, 5 Jun 2002 14:25:53 +0200
Hello

I want to code a usercontrol that have 3 rows (with one cell).
In the first row a title should be written.
the second row will contain the data, and the td background image should 
be set from the codebehind
the footer kan be 2 alternative rows.

i want to call the usercontrol with something like:
<mycontrols:mycontrol title=3D"This is a title" sqlQuery=3D"SELECT * 
from users order by name" databackground=3D"yellow" footer=3D"small" 
runat=3Dserver/>

How should I design the usercontorl?

headerRow:
<tr><td background=3D"<%=3D Application("ImgPath") %>/top.gif" 
height=3D"26">&nbsp;&nbsp;<asp:Image Runat=3Dserver 
ID=3Dicon/>&nbsp;<asp:Label Runat=3Dserver ID=3D"title" /></td>

dataRow:
<tr><td background=3D"<%=3D Application("ImgPath") 
%>/ThisNameShouldBeChangedFromCodeBehind"><asp:DataGrid Runat=3Dserver 
ID=3D"grid" /></td></tr>

one of the footer rows:
<!-- this one or the row below can be the footer row -->
<tr><td background=3D"<%=3D Application("ImgPath") 
%>/footer.gif"></td></tr>

the alternative footer row:
<!-- this is the alternative footerrow -->
<tr><td background=3D"<%=3D Application("ImgPath") %>/footer_big.gif" 
height=3D"26">&nbsp;</td></tr>

  Return to Index