Categories
ASP.NET Interview Questions and Answers
Here are Asp.net interview questions and answers for fresher as well as experienced candidates to get their dream job.
1. What is ASP.NET?
Microsoft released ASP.NET in 2002 to build dynamic websites and web applications using the .NET framework.
2. List the languages used for ASP.NET
Languages used by ASP.NET Framework are :
C#
C-Sharp is a programming language developed by Microsoft that runs on the .NET framework.
It is used for developing web applications on the .NET framework.
VB.NET
VB.NET is a modern object-oriented programming language developed by Microsoft to combine the features of CLR and .NET.
3. What is MVC?
Model:-
Model helps to create the data domain of the application and represents the public properties and business logic of the application.View:-
View represents the data tables, charts, and diagrams by collecting the data from the model.Controller:-
The controller helps in handling the user interactions and controls the flow of the application.4. What is the ASP.NET Life Cycle, and list the types of Life Cycle?
Life Cycle is classified into two categories.
Application Life Cycle:
The user requests for accessing the application.Page Life Cycle:
Page Life Cycle has phases like initialization, restoring, execution, and page rendering.5. What platform does ASP.NET use?
6. List the advantages of using ASP.NET
There are a lot of benefits of using ASP.NET. Here are some advantages:
1) Applications created using ASP.NET show better performance
2) ASP.NET provides multi-development modes for the applications
3) Applications created using ASP.NET can be used across the globe
4) ASP.NET is language independent
7. List types of Application Life Cycle.
Application Start:
Application Start is a method that you execute when a user makes a request.Object Creation:
Object Creation contains all the information about current requests and browsing information.HTTP Application:
HTTP Application processes all subsequent requests sent to the application.Application End:
Application End helps to unload the memory of an application.8. What is IIS? And why do you use it?
IIS has its own process engine to handle the requests. Using an IIS computer can work as a web server, and provides functionality to deploy ASP.NET Web applications. It is also responsible for providing responses to the requests made by the users.
9. What is CLR?
Services provided by CLR
1) Verification
2) Garbage collection
3) Security
4) Memory management
10. What type of Library is used in ASP.NET?
ASP.NET uses a Web Library to develop web applications.
11. List the components of ASP.NET.
They are:
1) Common Language Runtime
2) Language
3) Library
4) Common Type System
5) Windows Forms
12. Describe Web Forms?
It executes on the server and generates output to the browser. It also allows you to add and create custom controls.
Now, have a look at some custom controls provided by ASP.NET.
1) Label
2) TextBox
3) Button
4) Hyperlink
5) ImageButton
13. What is an Active Server Page?
ASP was first released in December 1996. It is used to generate the content that is sent to the client web browser via HTTP response.
14. Explain uses of Global.asax
Global file is also used to execute the application-level events and set application-level variables.
15. What type of protocol is used to call web service?
Web service in asp.net has three aspects, they are:
1) Creating web service
2) Creating a proxy
3) Consuming the web service
4) The HTTP protocol is used in ASP.NET to call a Web Service.
16. What is the difference between ASP and ASP.NET?
ASP | ASP.NET |
ASP is the first server-side scripting language developed by Microsoft to design dynamic WebForms. | ASP.NET is a server-side technology used for developing dynamic websites and web applications on the internet. |
ASP uses ADO(ActiveX Data Objects) to communicate with the database. | ASP.NET uses ADO.NET to communicate with the database. |
ASP is written in VBScript. | ASP.NET is written in C#. |
ASP.NET Interview Questions For Intermediate
Now, you will see some intermediate-level ASP.NET Interview Questions and Answers.
17. What is Caching?
Caching is also essential for data-related transactions.
18. List types of states in ASP.NET?
ASP.NET provides four types of states:
Application State:
It states all collections of web pages and files in a single directory on a web server.Cookie State:
It stores the information on the client machine.View State:
It states the state of the web page and its controls.Session State:
The session state is used to sort the application data.19. List the sources of data allowed by ASP.NET.
Some of the data sources allowed by ASP.NET.
1) SQL Data Source
2) Object Data Source
3) Linq Data Source
4) Access Data Source
20. What is the role of Page Directives?
Attributes of Page Directives are:
Buffer:
Enables and displays HTTP responseClientTarget:
Browses the server controlsClientName:
Specifies the class name of the pageDebug:
Enables or specifies compilation debugCodeFile:
Specifies the name of the code-behind file21. How is ASP.NET different from ASP.NET Core?
ASP.NET | ASP.NET Core |
ASP.NET is used to build applications for Windows. | ASP.NET Core is used for Windows, macOS, and Linux. |
Uses .NET framework | Uses .NET Core framework |
Single Version | Multiple Versions |
22. What is Late Binding?
23. What is Early Binding?
24. What is a Multi-View?
Multi-View has the prefix mv.
25. Describe a View State?
View state contains the following sections:
1) Features
2) Background
3) Scenario
4) Class Reference
26. What is a Web Library?
1) It contains base and user-defined data types
2) Access to data
3) Supports to create web services
27. List events of Calendar Control
1) Displaying Month
2) Selecting weeks and days
3) Selecting range
4) Displaying the days programmatically
The events of calendar control are three types:
1) Selection Changed
2) Day Render
3) Visible Month Changed
28. How can a page layout help in ASP.NET?
29. What is a Trace?
The trace contains features, background, code examples, and class references.
30. How can we add a Style sheet in Visual Studio?
31. List types of Caching.
Caching is divided into three types:-
Output Caching:
It specifies the duration of the cache and the attribute.Fragment Caching:
It is a user control caching used in a basic web form page.Data Caching:
It is used for caching the data of data source controls.32. List the most common built-in objects of ASP.NET?
Some common built-in objects of ASP.NET are:
Session:
Describes the methods and properties of the objects and stores the information related to the user.Context:
Describes wrapper for the object.Application:
Describes the methods and properties of the objects and stores the information related to the web application.Request:
Describes the methods and properties of the objects and stores the information related to the HTTP requests.Server:
Describes the methods and properties of the objects from various servers.Response:
Describes the methods and properties of the objects and stores the information related to the server response.33. Explain about Event Bubbling?
Event Bubble is classified into two categories:
OnBubbleEvent:
Handles the event data.RaiseBubbleEvent:
Sends the event data.34. List advantages of using HTML Server controls.
Some advantages of using HTML Server Controls are:
HTML Server Control does not possess any mechanism to identify the capabilities of a client browser.
Coding can be easy by adding the runat=”server” attribute.
Controls can interact with the Client-Side Scripting.
35. What are Breakpoints?
ASP.NET Interview Questions For Experienced
Now, you will see some advanced ASP.NET Interview Questions and Answers.
36. What are Button controls?
Syntax:-
Buttons are divided into three types, they are:
Simple Push Button:
Display the text in a rectangular area.Link Button:
Display text like a hyperlink.Image Button:
Displays an image.37. List five web controls in ASP.NET
1) HTML Controls
2) HTML Server Controls
3) User and Custom Controls
4) ASP.NET Server Controls
5) ASP.NET Ajax Server Controls
38. What is the role of Postback in ASP.NET?
Postback is submitted to a server before processing the page and holds credentials such as verification like username and passwords using a database.
39. List the types of Authentication in ASP.NET?
It is divided into four types:
1) Form Authentication
2) Windows Authentication
3) Custom Authentication
4) Passport Authentication
40. Define Web Configuration.
41. Explain Client-Side Script events
onclick:
It is used when the control is clicked.onfocus:
It is used when the control receives the focus.onchange:
It is used when the value of the control is changed.onblur:
It is used when the control loses focus.onkeypress:
It is used when the user presses the key.42. What is Form-Based Authentication?
Form-based authentication also provides a way to handle authentication using custom logics in ASP.NET applications.
43. Define Configuration files?
Configuration files are two types:
Web Configuration:
It contains the machine-specific value for all settings of the application.Machine Configuration:
It helps to extend, restrict and override the settings.44. List different types of cookies used in ASP.NET
The cookies in ASP.NET are divided into two types:
Session Cookie:
valid for a single session.Persistent Cookie:
valid for multiple sessions.45. Explain the difference between custom controls and user controls.
Custom Controls | User Controls |
Custom control is designed for a single application. | User control is designed for multiple applications. |
Custom control is loosely coupled. | User control is tightly coupled. |
User Interface can be changed. | The User Interface is fixed. |
46. What is a Range Validator and state its syntax?
Range Validator has three properties:
1) Type
2) MinimumValue
3) MaximumValue
47. What is a Thread Priority?
It is mainly used to set a value.
48. What is Anonymous Personalization?
49. Explain the difference between Web Configuration and Machine Configuration files?
Web Configuration | Machine Configuration |
Web Config is automatically created when an application is created. | Machine Config is automatically installed with Visual Studio. |
File inherits setting from the Machine Config. | Only one Machine Config exists. |
50. What is Entity Framework?
The .NET ecosystem has libraries you can use for this, such as ADO.NET. However, it can still be complicated to manually build SQL queries and convert the data from the database into C# classes back and forth.
EF, which stands for Entity Framework, is a library that provides an object-oriented way to access a database. It acts as an object-relational mapper, communicates with the database, and maps database responses to .NET classes and objects.
Entity Framework (EF) Core is a lightweight, open-source, and cross-platform version of the Entity Framework.
Cross-platform:
1) We can use EF Core in cross-platform apps that target .NET Core.
2) EF 6.x targets .NET Framework, so you’re limited to Windows.
Performance
EF Core is fast and lightweight. It significantly outperforms EF 6.x.M
Features:
EF Core has some features that EF 6.x doesn’t have (batching statements, client-side key generation, in-memory database for testing)