oscilatingcretin
oscilatingcretin

Reputation: 10919

Why does using <%=ConfigurationManager.AppSettings("MySetting")%> cause href attribute not to render in asp:HyperLink?

I am trying to bind a HyperLink control's NavigateUrl property in the markup using a server tag like so:

<asp:HyperLink ID="lnkHelp" runat="server" NavigateUrl='<%#ConfigurationManager.AppSettings("HelpUrl")%>'>Text</asp:HyperLink>

The IDE recognizes it and I even get intellisense, but the tag ends up rendering without the href attribute. I've discovered <%$ AppSettings:HelpUrl%> and I have started using this, but I don't get intellisense with it. That's not a deal breaker, but intellisense is just nice. That's a question for another time, though, so I am mainly just wanting to know why using <%# %> causes the href attribute not to render.

Upvotes: 0

Views: 574

Answers (1)

शेखर
शेखर

Reputation: 17614

You should use like this

NavigateUrl='<%$ ConfigurationSettings.AppSettings["HelpUrl"] %>'

Upvotes: 0

Related Questions