1

I am currently on a page with one querystring ItemID available, and I am creating a hyperlink that will redirect the user to a new page with the existing querystring ItemID.

I have the asp:hyperlink as below, but it is not clickable for some reason. Can someone help me out? Thanks!

<asp:HyperLink ID="hylItemReport" NavigateUrl='<%# "~/ItemReport.aspx?ItemID=" + Request.QueryString["ItemID"].ToString() %>' runat="server">Training Item</asp:HyperLink>
joseph.c
  • 146
  • 13

1 Answers1

1

If that HyperLink is not in a Repeater, GridView etc you need to call DataBind() in page load.

protected void Page_Load(object sender, EventArgs e)
{
    DataBind();
}
VDWWD
  • 35,079
  • 22
  • 62
  • 79
  • I Know ;) See this as to why: https://stackoverflow.com/questions/5833278/meaning-of-the-various-symbols-in-aspx-page-of-asp-net. `<%#` is a binding expression so databind has to be called. – VDWWD Oct 20 '17 at 19:25