Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
All-Star
27512 Points
4895 Posts
MVP
Feb 28, 2012 01:00 AM|LINK
Here's some sample code to get started. It's not for the exact section you wanted, but it will get you started on how to use the config API.
protected void _button_Click(object sender, EventArgs e) { Configuration configFile = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~"); System.Web.Configuration.AuthenticationSection section = (System.Web.Configuration.AuthenticationSection) configFile.GetSection("system.web/authentication"); section.Mode = System.Web.Configuration.AuthenticationMode.None; configFile.Save(); }
BrockAllen
All-Star
27512 Points
4895 Posts
MVP
Re: access sub elements of membership provider
Feb 28, 2012 01:00 AM|LINK
Here's some sample code to get started. It's not for the exact section you wanted, but it will get you started on how to use the config API.
protected void _button_Click(object sender, EventArgs e) { Configuration configFile = System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~"); System.Web.Configuration.AuthenticationSection section = (System.Web.Configuration.AuthenticationSection) configFile.GetSection("system.web/authentication"); section.Mode = System.Web.Configuration.AuthenticationMode.None; configFile.Save(); }DevelopMentor | http://www.develop.com
thinktecture | http://www.thinktecture.com/