How to get the authentication mode from web.config file programmatically at runtime?

 Posted by Raja on 7/9/2008 | Category: ASP.NET Interview questions | Views: 9259
Answer:

Write following code.


System.Web.Configuration.AuthenticationSection section =

(AuthenticationSection)WebConfigurationManager.GetSection("system.web/authentication");
Label1.Text = section.Mode.ToString();


You will get the authentication mode set in your web.config file.


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response