set control value in ascx

  • Thread starter Thread starter Peter
  • Start date Start date
P

Peter

Hi

I have an ascx file, which has a "hyperlink", eg:

<asp:HyperLink ID="myLink" Text="LINK" runat="server" NavigateUrl="" />

Is it possible to set the navigate-url dynamically in the ascx, or is
it only possible in the code-behind?

Eg. can I do something like:
<asp:HyperLink ID="myLink" Text="LINK" runat="server" NavigateUrl="<%=
urlString %>" />

(Where urlString is a string declared earlier on the ascx).

Thanks,
Peter
 
That should be possible, you can also call functions that are declared as
protected or public in the code behind too. Its the same way old ASP used to
work but its still valid (although not that nice) in ASP.NET
 
Back
Top