Michel
Michel

Reputation: 23605

how to use a resourcefile item in my aspx file?

this is my code:

<a target="_blank" href="<%$ Resources:WebsiteResource, linkUrl %>">..</a>

but i get this error that this is not allowed, that i have to use a literal. But this:

   <a target="_blank" href="<asp:literal runat="server" id="Literal1"></asp:literal>">..</a>

leads to this:

<a href=""<asp:literal" id="ctl00_ctl00_CPHMainSection_CPH_LeftSection_Literal1" target="_blank"></asp:literal>">

also tried this:

<a target="_blank" href="<%<asp:literal runat="server" id="Literal1"></asp:literal> %>">

but didn't work either...

Upvotes: 0

Views: 834

Answers (1)

Bonshington
Bonshington

Reputation: 4032

<a id="something" runat="server" target="_blank" href="<%$ Resources:WebsiteResource, linkUrl %>">..</a>

put runat="server" will make the magic. Because asp will ignore none server side control

Upvotes: 2

Related Questions