在ASP.NET Web窗体上的标记内设置“codebehind”属性

时间:2012-01-16 15:13:29

标签: c# asp.net

将以下代码放在网络表单的“标记”部分中不起作用

我是否搞砸了语法,或者在'服务器端'控件上是不可能的?

<asp:TextBox runat="server" ID="txt" Text='<%#System.Configuration.ConfigurationManager.AppSettings["foo"]  %>' />

1 个答案:

答案 0 :(得分:2)

使用$ expression

<asp:TextBox 
       runat="server" 
       ID="txt" 
       Text='<%$ AppSettings: foo %>'
相关问题