.NET Developer Interview Questions and Answers

There is a list of top frequently asked .NET Developer Interview Questions and Answers are given below.

1. What is Validation in ASP.NET?

Ans In ASP.NET, Validation controls validate the user input data to ensure that useless, unauthenticated data don’t get stored.

2. Difference between ASP and ASP.NET.


1. It is a partially object oriented language.1. It is fully object-oriented.
2. It uses language as VBScript, JScript.2. It uses compiled language like C#, VB.Net, ASP.Net etc.
3. ASP is interpreted language.3. ASP.Net is compiled language.
4. ASP uses ADO technology to connect database.4. ASP.Net uses ADO.Net technology to connect the database.
5. ASP script code Written with in HTML code.5. ASP.Net programming code written in C# language.

3. What is the Application Life Cycle in ASP.NET?

Ans In ASP.NET, a WEB page has execution Life-Cycle that includes 8 phases:

1. Page Request: When a page is requested by the user, ASP.NET parses and compiles that page.

2. Start: In this stage, page properties such as Request and Response are set. It also determines the Request type.

3. Initialization: During this stage, we can access the controls on the page but the control’s ViewState has not yet been initialized.

4. Load: In case of a postback, the control’s properties have been initialized from the ViewState.

5. Validation: Sometimes, there can be some validation set on the form.

6. Control Events: In the case of a postback, the control’s events are called.

7. Rendering: During the rendering stage, the page calls the Render method for each control and thus each control generates the HTML output that is merged with the resulting HTML of the page.

8. Unload: In this stage, the generated page output has already been sent to the client and the page can be discarded.

4. What is the ViewState in ASP.NET?

Ans Viewstate is a built-in structure for automatically retaining values amongst the multiple requests for the same page. The ViewState is internally maintained as a hidden field on the page.

5. What is Postback in ASP.NET?

Ans Postback is an event that is triggered when an action is performed by control on an asp.net page. when you click on a button the data on the page is posted back to the server for processing.

6. What are built-in objects in ASP.NET?

Ans The built-in objects in ASP.NET is given as below:
i. Application
ii. Request
iii. Response
iv. Server
v. Session
vi. Context
vii. Trace

7. How many types of configuration files in ASP.NET?

Ans There are three types of configuration files in ASP.NET:
i. Machine
ii. Application
iii. Security

8. What is HTTP Handler in ASP.NET?

Ans It is a type that runs in response to a request made to an ASP.NET application. A request can be for any type of ASP.NET resource but it is the HTTPHandler that generates the response. HTTP Handler is used to map incoming requests to the appropriate IHttpHandler or IhttpHandlerFactory class.

9. Define Caching in ASP.NET.

Ans Caching is the most important aspect of a high-performance web application. It provides a way of storing frequently accessed data and reusing the data.

10. How many types of session state modes in ASP.NET?

Ans There are four mode types of session state modes in ASP.NET.
i. In-Process mode
ii. State Server mode
iii. SQL Server mode
iv. Custom mode

11. What is HttpModule in ASP.NET?

Ans It enables you to configure the HTTP modules used within your application. This tag supports the <add>, <remove>, and <clear> subtags.The <add> subtag specifies the HTTP module class to add to your application. It has two attributes, type and name.

12. Difference between ADO.NET and ASP.NET.


1. It stands for ActiveX Data Objects.1. It stands for Active Server Pages.
2. It is a Library.2. It is a Framework.
3. It is a technology to access data from databases.3. It is a technology through which dynamic web pages can be created.
4. Here, It provides to convert the data into XML format.4. Here, We write our code into C#, VB.Net, ASP .Net etc.

13. Define DataSet and DataTable in .NET.

Ans DataSet: Dataset provides a disconnected representation of result sets from the Data Source. It is completely independent of the Data Source. It provides much greater flexibility when dealing with related result sets.
DataTable: The DataTable class is located in the .NET Framework at System.Data.DataTable. It represents a table of in-memory data that is contained with a Dataset object. It can be created automatically by returning result sets from the DataAdapter to the Dataset object.

14. What is ASP.NET MVC?

Ans ASP.NET MVC is an open-source framework built on the top of Microsoft .NET Framework to develop the website and web application. ASP.NET MVC framework is the most customizable and extensible platform.

15. What is Routing in ASP.NET MVC?

Ans Routing: A Routing is characterized by a few attributes, such as name, URL pattern, default values, constraints, data tokens, and a route handler. The attributes you set most often are name, URL pattern, and default values.

16. What is Razor View Engine in MVC?

Ans Razor View Engine: The Razor view engine employs a syntax that on one hand is familiar to nearly all ASP.NET developers. In ASP.NET MVC, the Razor view engine provides an alternate markup language to define the structure of view templates. According to Razor, a view template is an HTML page with a few placeholders and code snippets.

17. How many types of HTML Helpers?

Ans An HTML Helper is a method that returns an HTML string. The string can represent any type of content that you want.
There are three types of HTML helpers:
1. Inline HTML Helpers
2. Built-In HTML Helpers
3. Custom HTML Helpers

18. Define Action methods in ASP.NET MVC.

Ans Actions methods are defined in the controller class and responsible to perform required operations on the user’s inputs like form values, query strings values etc.

19. What are Data Annotations in ASP.NET MVC?

Ans Data Annotation: Data annotations are attributes, and attributes don’t typically contain code. They just represent meta-information for other modules to consume. By using data annotations, you decorate your model objects with metadata. This isn’t really expected to produce any visible effect: It all depends on how other components consume metadata.

20. How to enable and disable client-side validation in ASP.NET MVC?

Ans We can enable the client-side validation:

<add key="ClientValidationEnabled" value="true" />

<add key="UnobtrusiveJavaScriptEnabled" value="true" />

We can disable the client-side validation:

<add key="ClientValidationEnabled" value="false" />

<add key="UnobtrusiveJavaScriptEnabled" value="false" />

Leave a Reply

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