开发者

Get Settings value in .aspx page?

开发者 https://www.devze.com 2023-03-09 16:06 出处:网络
Is it possible to get Setti开发者_C百科ngs value in .aspx page? My settings in web.config looks like this:

Is it possible to get Setti开发者_C百科ngs value in .aspx page?

My settings in web.config looks like this:

<applicationSettings>
<School.Properties.Settings>
    <setting name="StudentUrl" serializeAs="String">
     <value>http://www.studentUrl.com</value>
   </setting>
</School.Properties.Settings>
</applicationSettings>

My aspx page looks like this:

<asp:HyperLink ID="lnkSchoolUrl" runat="server" Target="_blank" NavigateUrl="">Click for Student URL</asp:HyperLink>

How to get my 'StudentUrl' value from Web.config in hyperlink in aspx page?


Thanks guys. but i decided to go with this solution: Binding ASP.Net Web.Config Settings To .ASPX File <a href></a>?


In your code behind, try this:

School.Properties.Settings settings = new School.Properties.Settings();
String StudentUrl = settings.StudentUrl;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号