In this section we will touch base on one of important concepts in ASP.NET. You can download my .NET Interview Question PDF from http://www.questpond.com/SampleDotNetInterviewQuestionBook.zip .
I have also put all these design patterns in a video format and uploaded on http://www.questpond.com/FreeDesign1.htm . You can visit http://www.questpond.com and download the complete architecture interview questions PDF which covers SOA, UML, Design
Patterns, Togaf , OOPs etc.
You can download the software architecture interview questions PDF here:
Download Software Architecture Interview Questions.
Previous parts of my interview questions series for architects:
UML interview questions: Part 1: SoftArch5.aspx
Happy job hunting......
(B) What is the sequence in which ASP.NET events are processed?
Following is the sequence in which the events occur:
- 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 requests of the page.
(B) In which event are the controls fully loaded?
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.
(B) How can we identify that the Page is postback?
Page object has an
IsPostBack property which can be checked to know if the page
was posted back.
(B) How does ASP.NET maintain state in between subsequent requests?
Refer caching chapter.
(A) What is event bubbling?
Server controls like
Repeater can have other child controls inside them.
For example, DataGrid can have a combobox inside DataGrid. These child controls do not raise their events by themselves, rather they pass the event to the container parent (which can be a
Repeater), which are
passed to the page as an
ItemCommand event. As the child control sends events to
the parent it is termed as event bubbling.
(B) How do we assign page specific attributes?
Page attributes are specified using the
(A) How do we ensure view state is not tampered?
@Page directive and setting the
EnableViewStateMac property to
(B) What is the use of @Register directives?
@Register directive informs the compiler of any custom server control added to the page.
(B) What is the use of the Smart Navigation property?
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 the IE browser. Project with browser compatibility requirements have to think
of other ways to avoid flickering.
(B) What is the AppSetting
section in the Web.Config file?
The Web.config file defines the configuration for a web project. Using
AppSetting section, we can define user-defined values. The example below defines
the “Connection String” section which will be used throughout the project for
the database connection.
<add key="ConnectionString" value="server=xyz;pwd=www;database=testing" />
(B) Where is the ViewState information stored?
In the HTML hidden fields.
(I) What is the use of
the @OutputCache directive in ASP.NET?
It is used for caching. See more in the Caching article.
(B) How can we create custom controls in ASP.NET?
User controls are created using .ASCX in ASP.NET. After the .ASCX file is created you need two things
so that the ASCX can be used in the project:
- Register the ASCX control in the page using the
<%@ Register directive. Example:
<%@ Register tag prefix="Accounting" Tag name="footer" Src="Footer.ascx" %>
Now to use the above accounting footer in the page, you can use the below directive:
<Accounting: footer runat="server" />
(B) How many types of validation controls are provided by ASP.NET?
There are six main types of validation controls:
RequiredFieldValidator: It checks whether the control has any value. It is used when you want the control
to not be empty.
RangeValidator: It checks if the value in the validated control is in that specific range. Example,
TxtCustomerCode should not be more than eight lengths.
CompareValidator: It checks that the value in the controls should match some specific value. Example,
TxtPie should be equal to 3.14.
RegularExpressionValidator: When we want the control, the value should match with a specific regular expression.
CustomValidator: It is used to define User Defined validation.
ValidationSummary: It displays summary of all current validation errors on an ASP.NET page.
Note: It is rare that someone will ask step by step about all the
validation controls. Rather they will ask for what type of validation a validator will be used.
For example in one of the interviews I was asked how to display the summary of all errors in
a validation control... just uttered one word:
(B) Can you explain AutoPostBack?
If we want the control to automatically post back in case of an event, we will need to check this attribute as
true. For example, on a ComboBox change, we need to send the event immediately to the server side then set the
AutoPostBack attribute to
(B) How can you enable automatic paging in DataGrid?
Following are the things to be done in order to enable paging in DataGrid:
AllowPaging to true.
- In the
PageIndexChanged event set the current page index clicked.
Note: The answers are very short, if you have implemented them practically it
is just a revision. If you are a fresher, just make a sample code using a DataGrid and try to implement this functionality.
(B) What is the use of the GLOBAL.ASAX file?
It allows to execute ASP.NET application level events and set application-level variables.
(B) What is the difference between
Web.config and Machine.Config?
Web.config files apply settings to each web application, while Machine.config file apply settings to all ASP.NET applications.
(B) What is a SESSION and APPLICATION object?
The Session object stores information between HTTP requests for a particular user, while
the Application object is global across users.
Other interview questions PDFs