Configuration ASP.Net Tutorial

<%@ Page Language="C#" %>
<%@ Import Namespace="System.Web.Configuration" %>
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    void Page_Load()
    {
        if (!Page.IsPostBack)
        {
            Configuration config = WebConfigurationManager.OpenWebConfiguration (Request.ApplicationPath);
            CompilationSection section = (CompilationSection)config.GetSection ("system.web/compilation");
            chkDebug.Checked = section.Debug;
        }
    }
    protected void btnUpdate_Click(object sender, EventArgs e)
    {
        Configuration config = WebConfigurationManager.OpenWebConfiguration (Request.ApplicationPath);
        CompilationSection section = (CompilationSection)config.GetSection ("system.web/compilation");
        section.Debug = chkDebug.Checked;
        config.Save(ConfigurationSaveMode.Modified);
    }



    Show Config Modify


    
    

            id="chkDebug"
        Text="Enable Debugging?"
        Runat="server" />
    
            id="btnUpdate"
        Text="Update"
        OnClick="btnUpdate_Click"
        Runat="server" />
    

    


File: Web.Config