我有一个问题:我什么时候使用<%= ConfigurationManager.AppSettings["xxx"] %>
and <%$ AppSettings: xxx %>
。
有时,当我使用<%= ConfigurationManager.AppSettings["xxx "] %>
a 时,会出现以下错误:“服务器标签不能包含 <% ... %> 构造”。然后一个看跌<%$ AppSettings: xxx %>
,它的工作原理。
像这个例子:错误:
<asp:Literal runat="server" ID="Literal9" Text="<%= ConfigurationManager.AppSettings["xxx"] %>"></asp:Literal>
在职的:
<asp:Literal runat="server" ID="Literal9" Text='<%$ AppSettings: xxx %>'></asp:Literal>