Get Settings value in .aspx page?
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;
精彩评论