Sunday, February 1, 2009

Defining and Using Application settings

Definining application settings


Open web.config file of your application Find: tag
Type settings you need, For example:








Using application settings


You have to use in you code behind file reference to this namespace
using System.Configuration;


protected void Page_Load(object sender, EventArgs e)
{
string copyright = ConfigurationManager.AppSettings["CopyrightMessage"];
string email = ConfigurationManager.AppSettings["ContactEmail"];
}

No comments:

Post a Comment