1

My question is just similar to this question How to read web.config settings in .aspx page?

Just a modification is that I want the label text in ASPX page as such:

<asp:Label ID="lblmyLabel" runat="server" Text="<%$ ConfigurationSettings.AppSettings["MyLabel"]%>"></asp:Label>

But it give me the error "Cannot resolve the symbol (lblmyLabel)"

How to achieve this task?

Community
  • 1
  • 1
AbdulAziz
  • 5,868
  • 14
  • 56
  • 77

1 Answers1

3

You can use

<asp:Label ID="lblmyLabel" runat="server" Text="<%$appSettings:MyLabel %>"></asp:Label>
Pragnesh Khalas
  • 2,908
  • 2
  • 13
  • 26