Asp Net Interview Questions Csharpcorner

Types of authentication and authorization in ASP.NET

There are three ways of doing authentication and authorization in ASP.NET:

Windows authentication

In this methodology ASP.NET web pages will use local windows users and groups to authenticate and authorize resources.

Forms Authentication

This is a cookie based authentication where username and password are stored on client machines as cookie files or they are sent through URL for every request. Form-based authentication presents the user with an HTML-based Web page that prompts the user for credentials.

Passport authentication

Passport authentication is based on the passport website provided by the Microsoft .So when user logins with credentials it will be reached to the passport website ( i.e. hotmail,devhood,windows live etc) where authentication will happen. If Authentication is successful it will return a token to your website.

Anonymous access

If you do not want any kind of authentication then you will go for Anonymous access.

In web.config file set the authentication mode to Windows as shown in the below code snippets.

We also need to ensure that all users are denied except authorized users. The below code snippet inside the authorization tag that all users are denied. ? indicates any unknown user.

For further info click on the link:

Question 25 – Describe application state management in ASP.NET?

Answer: Application Level State Management is used to maintain the state of all the users accessing the web forms present within the website. The value assigned for an application is considered as an object. Application object will not have any default expiration period. Whenever the webserver has been restarted or stopped then the information maintained by the application object will be lost. If any data is stored on the application object then that information will be shared upon all the users accessing the webserver. Since the information is shared among all the users, it is advisable to lock and unlock the application object as per requirement. Global Application Class(Global.asax) It is a Class which consists of event handlers which executes the code implicitly whenever a relevant task has been performed on the web server.Design:

For further info click on the link,

Question 11 – What are the Advantages of ASP.NET?

Answer: ASP.NET provides services to allow the creation, deployment, and execution of Web Applications and Web Services like ASP. ASP.NET is a server-side technology. Web applications are built using Web Forms. ASP.NET comes with built-in Web Form controls, which are responsible for generating the user interface. They mirror typical HTML widgets such as text boxes or buttons. If these controls do not fit your needs, you are free to create your own user controls. Advantages of ASP.NET,

  • Separation of Code from HTML
  • Support for compiled languages
  • Use services provided by the .NET Framework
  • Graphical Development Environment
  • Update files while the server is running
  • XML-Based Configuration Files
  • For further info click on the link:

    46) How to handle errors in Web API?

    Several classes are available in Web API to handle errors. They are HttpError, HttpResponseException, Exception Filters, Registering Exception Filters.

    Question 21 – What is authentication and authorization in ASP.NET?


  • Authentication: Prove genuineness
  • Authorization: process of granting approval or permission on resources.
  • In ASP.NET authentication means to identify the user or in other words its nothing but validating that he exists in your database and he is the proper user. Authorization means does he have access to a particular resource on the IIS website. A resource can be an ASP.NET web page, media files (MP4, GIF, JPEG etc), compressed file (ZIP, RAR) etc.

    .NET Interview Questions And Answers | ASP.NET Interview Questions And Answers | 2022 | Simplilearn

    Related Posts

    Leave a Reply

    Your email address will not be published. Required fields are marked *