ASP .NET Interview Questions
Exam Name | ASP .NET Interview Questions |
---|---|
Description | ASP .NET Interview Questions contains the questions from various interview of IT industry.These questions are helpful to crack the IT interview. |
Exam Type | PUBLIC |
Authenticity | 3 |
creator | Anirudh(39306) |
.
Question:
What is ASP .NET?
Answer:
Question:
What is the concept of Postback in ASP.NET?
Answer:
ASP.NET was introduced with a mechanism to post an HTTP POST request back to the same page. It's basically posting a complete page back to server (i.e. sending all of its data) on same page. So, the whole page is refreshed.
Another concept related to this approach is "Callback" that is also asked sometimes during a technical interview question. Click here to understand Postback Vs Callback in ASP.NET.
Question:
Difference between ASP.NET WebForms and ASP.NET MVC?
Answer:
Question:
Please briefly explain ASP.NET Page life Cycle?
Answer:
Please follow for detailed information on WebForms Vs MVC.
Please briefly explain ASP.NET Page life Cycle?
ASP.NET page passes through a series of steps during its life cycle. Following is the high-level explanation of life cycle stages/steps.
Initialization: Controls raise their Init event in this stage.Objects and variables are initializes for complete lifecyle of request.
LoadViewState: is a post back stage and loads the view state for the controls that enabled its view state property.
LoadPostBackData: is also a post back stage and loads the data posted for the controls and update them.
Load: In this stage page as well as all the controls raise their Load event. Till this stage all the controls are initialized and loaded. In most of the cases, we are coding this event handler.
RaisePostBackEvent: is again a postback stage. For example, it's raise against a button click event. We can easily put our code here to perform certain actions.
SaveViewState: Finally, controls state is saved in this stage before Rendering HTML.
Render: This is the stage where HTML is generated for the page.
Dispose: Lastly, all objects associated with the request are cleaned up.
Question:
What is the difference between custom controls and user controls?
Answer:
But User Controls (.ascx) are just like pages (.aspx). These are comparatively easy to create but tightly couple with respect to User Interface and code. In order to use across multiple projects, we need to copy and paste to the other project as well.
Question:
What is the concept of view state in ASP.NET?
Answer:
Question:
Difference between Response.Redirect and Server.Transfer?
Answer:
While in case of Server.Transfer, a request is transferred from one page to another without making a round trip from client. For the end user, URL remains the same in browser even after transferring to another page.
Question:
Please briefly explain the usage of Global.asax?
Answer:
There is a good list of events that are fired but following are few of the important events in Global.asax:
Application_Init occurs in case of application initialization for the very first time.
Application_Start fires on application start.
Session_Start fires when a new user session starts
Application_Error occurs in case of an unhandled exception generated from application.
Session_End fires when user session ends.
Application_End fires when application ends or time out.
Question:
What are the different types of Validation controls in ASP.NET?
Answer:
ASP.NET provides a range of validation controls:
RequiredFieldValidator validates compulsory/required input.
RangeValidator validates the range. Validates that input falls between the given range values.
CompareValidator validates or compares the input of a control with another control value or with a fixed value.
RegularExpressionValidator validates input value against a defined regular expression pattern.
CustomValidator allows to customize the validation logic with respect to our application logic.
ValidationSummary displays all errors on page collectively.
Question:
What are the types of Authentication in ASP.NET?
Answer:
Question:
What are Session state modes in ASP.NET?
Answer: