Variable inside of the markup for an asp:HyperLink NavigationUrl property?

Posted by RichAmberale on Stack Overflow See other posts from Stack Overflow or by RichAmberale
Published on 2010-03-09T00:32:56Z Indexed on 2010/03/09 0:36 UTC
Read the original article Hit count: 213

Filed under:

Hi,

I'm new to ASP.NET and can't figure out how to accomplish this...

My code (that needs fixing):

<asp:HyperLink runat="server"
          NavigateUrl="~/EditReport.aspx?featureId=<%= featureId %>" 
          ImageUrl="~/new.gif" />

featureId gets defined as an integer in the backing code. I want href's like...

  /EditReport.aspx?featureId=2224

...but instead I am getting...

  /EditReport.aspx?featureId=<%= featureId %>

© Stack Overflow or respective owner

Related posts about ASP.NET