Configuration ASP.Net Tutorial

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

    void Page_Load()
    {
        if (!Page.IsPostBack)
            BindSections();
    }
    protected void grdSections_RowCommand(object sender, GridViewCommandEventArgs e)
    {
        int rowIndex = Int32.Parse((string)e.CommandArgument);
        string sectionName = (string)grdSections.DataKeys[rowIndex].Value;
        if (e.CommandName == "Protect")
            ProtectSection(sectionName);
        if (e.CommandName == "UnProtect")
            UnProtectSection(sectionName);
        BindSections();
    }
    private void ProtectSection(string sectionName)
    {
        Configuration config = WebConfigurationManager.OpenWebConfiguration (Request.ApplicationPath);
        ConfigurationSection section = config.GetSection(sectionName);
        section.SectionInformation.ProtectSection ("RsaProtectedConfigurationProvider");
        config.Save(ConfigurationSaveMode.Modified);
    }
    private void UnProtectSection(string sectionName)
    {
        Configuration config = WebConfigurationManager.OpenWebConfiguration (Request.ApplicationPath);
        ConfigurationSection section = config.GetSection(sectionName);
        section.SectionInformation.UnprotectSection();
        config.Save(ConfigurationSaveMode.Modified);
    }
    private void BindSections()
    {
        Configuration config = WebConfigurationManager.OpenWebConfiguration (Request.ApplicationPath);
        List colSections = new List();
        foreach (ConfigurationSection section in config.SectionGroups["system.web"].Sections)
            colSections.Add(section.SectionInformation);
        grdSections.DataSource = colSections;
        grdSections.DataBind();
    }



    Encrypt Config


    
    

            id="grdSections"
        DataKeyNames="SectionName"
        AutoGenerateColumns="false"
        OnRowCommand="grdSections_RowCommand"
        Runat="server" >