Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/305.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 是否在.aspx页面中获取设置值?_C#_.net_Asp.net_Xml - Fatal编程技术网

C# 是否在.aspx页面中获取设置值?

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

是否可以在.aspx页面中获取设置值

我在web.config中的设置如下所示:

<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?