ASP.NET Exclusive Interview Questions and Answers (348) - Page 1

  • A joint initiative from DotNetFunda.Com and Questpond.
  • A one stop place on the internet to get trusted and proven Interview Questions (based on more than a decade of experience in this field) to ensure the success of the candidates.
  • You will find almost all Interview questions from Questpond here and this list is growing day by day with all latest and updated interview questions.

348 records found.

Get 650+ Questpond's Interview videos on discount

What is the sequence in which ASP.NET events are processed?

Answer: -
Following is the sequence in which the events occur:-
• Page_Init.
• Page Load.
• Control events
• Page- Unload event.
Page_init event only occurs when first time the page is started, but Page Load occurs in subsequent request of the page.
In which event are the controls fully loaded?

Answer: -
Page load event guarantees that all controls are fully loaded. Controls are also accessed in Page_Init events but you will see that view state is not fully loaded during this event.5

What is event bubbling?

Answer: -
Server controls like Data grid, Data List, and Repeater can have other child controls inside them. Example Data Grid can have combo box inside data grid. These child control do not raise there events by themselves, rather they pass the event to the container parent (which can be a data grid, data list, repeater), which passed to the page as “ItemCommand” event. As the child control send events to parent it is termed as event bubbling.

How do we assign page specific attributes?

Answer: -
Page attributes are specified using the @Page directive.

How do we ensure view state is not tampered?

Answer: -
Using the @Page directive and setting ‘EnableViewStateMac’ property to True.

What is the use of @ Register directives?

Answer: -
@Register directive informs the compiler of any custom server control added to the page.

What is the use of Smart Navigation property?

Answer: -
It’s a feature provided by ASP. NET to prevent flickering and redrawing when the page is posted back.

Note: - This is only supported for IE browser. Project is who have browser compatibility as requirements have to think some other ways of avoiding flickering.

What is AppSetting Section in “Web.Config” file?

Answer: -
Web.config file defines configuration for a web project. Using “AppSetting” section, we can define user-defined values. Example below defined is “Connection String” section, which will be used through out the project for database connection.

<add key="ConnectionString" value="server=xyz;pwd=www;database=testing" />

Where is View State information stored?

Answer: -
In HTML Hidden Fields.

How can we create custom controls in ASP.NET?

Answer: -
User controls are created using .ASCX in ASP.NET. After .ASCX file is created you need to two things in order that the ASCX can be used in project: -

• Register the ASCX control in page using the <percentage@ Register directive.Example

<%@ Register tag prefix="Accounting" Tag name="footer" Src="Footer.ascx" %>

• Now to use the above accounting footer in page you can use the below directive.

<Accounting: footer runat="server" />

How many types of validation controls are provided by ASP.NET?

Answer: -
There are six main types of validation controls: -


It checks whether the control have any value. It is used when you want the control should not be empty.


It checks if the value in validated control is in that specific range. Example TxtCustomerCode should not be more than eight lengths.


It checks that the value in controls should match some specific value. Example Textbox TxtPie should be equal to 3.14.


When we want the control, value should match with a specific regular expression.


It is used to define User Defined validation.

Validation Summary

It displays summary of all current validation errors on an ASP.NET page.

Note: - It is rare that some one will ask step by step all the validation controls. Rather they will ask for what type of validation which validator will be used. Example in one of the interviews i was asked how will you display summary of all errors in the validation control...just uttered one word Validation summary.

Can you explain “AutoPostBack”?

Answer: -
If we want the control to automatically post back in case of any event, we will need to check this attribute as true. Example on a Combo Box change we need to send the event immediately to the server side then set the “AutoPostBack” attribute to true.

How can you enable automatic paging in Data Grid?

Answer: -
Following are the points to be done in order to enable paging in Data grid:-
• Set the “Allow Paging” to true.
• In PageIndexChanged event set the current page index clicked.

Note: - The answers are very short, if you have implemented practically its just a revision. If you are fresher, just make sample code using Datagrid and try to implement this functionality.

What is the use of “GLOBAL.ASAX” file?

Answer: -
It allows to execute ASP.NET application level events and setting application-level variables.

What is the difference between “Web.config” and “Machine.Config”?

Answer: -
“Web.config” files apply settings to each web application, while “Machine.config” file apply settings to all ASP.NET applications.

What is a SESSION and APPLICATION object?

Answer: -
Session object store information between HTTP requests for a particular user, while application object are global across users.

How can we check if all the validation control are valid and proper?

Answer: -
Using the Page.IsValid () property you can check whether all the validation are done.

If client side validation is enabled in your Web page, does that mean server side code is not run?

Answer: -
When client side validation is enabled server emit’s JavaScript code for the custom validators. However, note that does not mean that server side checks on custom validators do not execute. It does this redundant check two times, as some of the validators do not support client side scripting.

More ASP.NET Interview Questions & Answers here

Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Exclusive Interview Questions and Answers Categories