Asp.Net mvc Interview Questions and Answers

Basic Asp.Net C# interview Questions for freshers

Q. What is the authentication and authorization in ASP.NET ?
A. 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 to validate 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.

Q. Types of authentication and authorization in ASP.NET?
A. 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.
Asp.Net interview questions and answers pdf C# Languages using to develop web forms in Visual Studio business requirements
Online Courses

WebForms Development | MVC Core Interview Questions and Answers

Q. What is the code behind and Inline Code in
A. Code Behind
Code Behind refers to the code for an ASP.NET Web page that is written in a separate class file that can have the extension of .aspx.cs or .aspx.vb depending on the language used. Here the code is compiled into a separate class from which the .aspx file derives. You can write the code in a separate .cs or .vb code file for each .aspx page. One major point of Code Behind is that the code for all the Web pages is compiled into a DLL file that allows the web pages to be hosted free from any Inline Server Code.
Inline Code
Inline Code refers to the code that is written inside an ASP.NET Web Page that has an extension of .aspx. It allows the code to be written along with the HTML source code using a script tag. It's major point is that since it's physically in the .aspx file it's deployed with the Web Form page whenever the Web Page is deployed.

Q. What is the ASP.NET page life Cycle?
A. When a page is requested by the user from the browser, the request goes through a series of steps and many things happen in the background to produce the output or send the response back to the client. The periods between the request and response of a page is called the "Page Life Cycle".
Request: Start of the life cycle (sent by the user).
Response: End of the life cycle (sent by the server).
There are four stages that occur during the Page Life Cycle before the HTML Response is returned to the client. Later in this article we’ll study all these stages and their sub events.

top architect interview questions and answers for cSharptop core interview Questions and Answers

beginners C# with interview questions and answers

Q. How we can force all the validation controls to run?
A. The Page.Validate() method is used to force all the validation controls to run and to perform validation.

Q. List all templates of the Repeater control in framework?
A. ItemTemplate

Web development fullstack course Web development course 2021: Fullstack
Online course Online Courses: Include Certification
Harisystems is optimized for learning, testing and training. courses are designed to be simplified to improve reading and basic understanding for beginners to expert level. Tutorials and examples are constantly reviewed to avoid errors, however we cannot warrant full correctness of all content. if any found need to correct write us at we Harisystems is not responsible for any with this tutorials, While using this site, you agree to have read and accepted our terms of use, cookie and privacy policy. Copyright 2007-2022 by Harisystems. All Rights Reserved.
Copyright © Harisystems 2022