Created
December 12, 2013 06:14
-
-
Save jinweijie/7923887 to your computer and use it in GitHub Desktop.
Dynamic modify LoginUrl for FormsAuthentication
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| System.Configuration.Configuration configuration = | |
| WebConfigurationManager.OpenWebConfiguration("/YourSite"); | |
| // Get the external Authentication section. | |
| AuthenticationSection authenticationSection = | |
| (AuthenticationSection)configuration.GetSection( | |
| "system.web/authentication"); | |
| // Get the external Forms section . | |
| FormsAuthenticationConfiguration formsAuthentication = | |
| authenticationSection.Forms; | |
| formsAuthentication.LoginUrl = "http://google.com"; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment