RSS Links

 

Here are all of the RSS links for sections of this site

VB.NET/ASP.NET
 Java
 Unix/Linux
 Windows
 SQL Server

Home arrow VB.NET/ASP.NET arrow Why in UserControls the tags aren't working
Why in UserControls the tags aren't working PDF Print
This problem catches me everytime - I create a user control

<foot:footer id="Foot1" runat="server" />

and I add a new property called prop which I want to assign a value using server tags

<foot:footer id="Foot1" runat="server" prop="<%= GetTheProperty() %>" />

which just doesn't work.

The reason that it isn't working is that its a server based control and is entirely setup serverside, so to get it working you
need to add an additional DataBind in the page_load sub and to user the late binding version of the server tags (<%#)

i.e.

<foot:footer id="Foot1" runat="server" prop="<%# GetTheProperty() %>" />
Page.Form.FindControl("Foot1").DataBind()

would do it for the above example


 
< Prev   Next >
 
Designed by Graham Robinson Software