Live Chat Icon For mobile
Live Chat Icon

How to create Custom Application Settings in the web.config

Platform: ASP.NET| Category: Miscellaneous

In the web.config file add a key-value pair as follows:


<configuration>
<appSettings>
	<add key='PageSize' value='10'>
	</add>
</appSettings>
</configuration>

Then you can access the settings as follows in code:

VB.NET


Response.Write (ConfigurationSettings.AppSettings('PageSize'))

C#


Response.Write (ConfigurationSettings.AppSettings['PageSize'] );

Share with

Related FAQs

Couldn't find the FAQs you're looking for?

Please submit your question and answer.