现在的位置: 首页 > 综合 > 正文

前台直接读取Web.config中的值的方法 (转)

2013年08月23日 ⁄ 综合 ⁄ 共 398字 ⁄ 字号 评论关闭

转自: http://www.cnblogs.com/zhucl1006/archive/2008/04/02/1134150.html

 

<asp:TextBox ID="ttel2" runat="server" Width="95%" Text='<%$AppSettings:DefualtV_Tel%>' onFocus=OnEnter(this) onBlur=OnExit(this)></asp:TextBox>

 

假如是html控件,必须runat=server

 

此方法适用于vs2005/vs2008, 2003没试过

 

这种方法还可以用在资源读取,例如

<siteMapNode url="~/pages/contents/blogbooksolutions" title="$Resources:siteMap,Link42,Blogbook/BlogPrint"  description="" />

 

抱歉!评论已关闭.