set control value in ascx

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
 
C

Ciaran O''Donnell

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top