Get settings value on .aspx page?

Is it possible to get the parameter value on the .aspx page?

My settings in web.config are as follows:

<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 a hyperlink on an aspx page?

+3
source share
2 answers

Thanks guys. but I decided to go with this solution: Linking ASP.Net Web.Config settings to .ASPX <a href> </a>?

0
source

In your code behind, try the following:

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

All Articles