Inside my GridView I have this:
<asp:TemplateField HeaderText="Issue">
<ItemTemplate>
<asp:HyperLink ID="EscalationHyperlink" runat="server" NavigateUrl='<%# EscalationGetNavigateUrl(Eval("ID")) %>' Text='<%# Eval("ID") %>'>
</asp:HyperLink>
</ItemTemplate>
</asp:TemplateField>
It won't show a hyperlink in the resulting GridView. The "Text" value is correct, it's just not a hyperlink. This GridView is embedded in an UpdatePanel and is being generated by the user pushing a button.
If I set a breakpoint inside EscalationGetNavigateUrl() it trips when the button is pressed, and it returns the correctly formatted hyperlink, which is weird.
To make matters more interesting, I have this exact markup all over the place and it seems to work fine on other pages, just not this one.
Any ideas on where I might be going wrong (or a better way to debug it)? It's like the generated value from the code-behind just isn't making it to the browser somehow.
The code-behind looks like this:
protected string EscalationGetNavigateUrl(object field)
{
return String.Format("~/EscalationDetails.aspx?EscalationId={0}", field);
}
EDIT: I already said this in the comments below, but I wanted to add some output that's returned from the server. It looks like this:
<a id="MainContent_ClosedCREscGridView_EscalationHyperlink_0">175</a>
You'll notice there is no href on the link.
A) element? What does the markup look like (view source)? Does something setEnabled=false? IIRC disabled ASP:HyperLink controls will Render as plaintext instead of as links. (er wait,maybe they just renderdisabled=disabledso the browser doesn't act on it like a link.. anyway, check the markup after render and post the resulting HTML please.