set control value in ascx

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter

    #1

    set control value in ascx

    Hi

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

    <asp:HyperLin k 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:HyperLin k ID="myLink" Text="LINK" runat="server" NavigateUrl="<% =
    urlString %>" />

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

    Thanks,
    Peter
  • =?Utf-8?B?Q2lhcmFuIE8nJ0Rvbm5lbGw=?=

    #2
    RE: set control value in ascx

    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

    --
    Ciaran O''Donnell



    "Peter" wrote:
    Hi
    >
    I have an ascx file, which has a "hyperlink" , eg:
    >
    <asp:HyperLin k 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:HyperLin k ID="myLink" Text="LINK" runat="server" NavigateUrl="<% =
    urlString %>" />
    >
    (Where urlString is a string declared earlier on the ascx).
    >
    Thanks,
    Peter
    >

    Comment

    Working...