Posted on: 4/8/2012 8:59:32 PM | Views : 530

Hiii, i have very simple question, may b i had made any stupid mistake somewhere but i m not so good to find out it, here is my code, my boolean value is not changing, everytimes it will remain true , i want to change it on every click .
static bool myboolean; protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { myboolean = !(myboolean); encrypt(myboolean); } public void encrypt(bool b) { Configuration config = WebConfigurationManager.OpenWebConfiguration(System.Web.Hosting.HostingEnvironment.ApplicationVirtualPath); ConfigurationSection section = config.GetSection("connectionStrings"); if (b) section.SectionInformation.ProtectSection("DataProtectionConfigurationProvider"); else section.SectionInformation.UnprotectSection(); config.Save(); ...

Go to the complete details ...