C# 是否在.aspx页面中获取设置值?
是否可以在.aspx页面中获取设置值 我在web.config中的设置如下所示:C# 是否在.aspx页面中获取设置值?,c#,.net,asp.net,xml,C#,.net,Asp.net,Xml,是否可以在.aspx页面中获取设置值 我在web.config中的设置如下所示: <applicationSettings> <School.Properties.Settings> <setting name="StudentUrl" serializeAs="String"> <value>http://www.studentUrl.com</value> </setting> </Scho
<applicationSettings>
<School.Properties.Settings>
<setting name="StudentUrl" serializeAs="String">
<value>http://www.studentUrl.com</value>
</setting>
</School.Properties.Settings>
</applicationSettings>
<asp:HyperLink ID="lnkSchoolUrl" runat="server" Target="_blank" NavigateUrl="">Click for Student URL</asp:HyperLink>
http://www.studentUrl.com
我的aspx页面如下所示:
<applicationSettings>
<School.Properties.Settings>
<setting name="StudentUrl" serializeAs="String">
<value>http://www.studentUrl.com</value>
</setting>
</School.Properties.Settings>
</applicationSettings>
<asp:HyperLink ID="lnkSchoolUrl" runat="server" Target="_blank" NavigateUrl="">Click for Student URL</asp:HyperLink>
单击查找学生URL
如何从aspx页面的超链接中的Web.config获取我的“StudentUrl”值?谢谢大家。但我决定采用这种解决方案:
?在您的代码隐藏中,尝试以下操作:
School.Properties.Settings settings = new School.Properties.Settings();
String StudentUrl = settings.StudentUrl;
您是否尝试使用System.Configuration.ConfigurationManager?