Following is the sequence in which the events occur :-
√ 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.
(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 viewstate is not fully loaded during this event.
(B) How can we identify that the Page is PostBack ?
Page object has a “IsPostBack” property which can be checked to know that is the page
(B) How does ASP.NET maintain state in between
subsequent request ?
Refer caching chapter.
(A) What is event bubbling ?
Server controls like Datagrid , DataList , Repeater can have other child controls inside
them.Example DataGrid can have combo box inside datagrid.These child control do not
raise there events by themselves , rather they pass the event to the container parent
(which can be a datagrid , datalist , repeater) , which passed to the page as “ItemCommand”
event.As the child control send there events to parent this is termed as event bubbling.
(B) How do we assign page specific attributes ?
Page attributes are specified using the @Page directive.
(A) Administrator wants to make a security check that no
one has tampered with ViewState , how can he ensure this ?
Using the @Page directive EnableViewStateMac to True.
(B) What’s the use of @ Register directives ?
@Register directive informs the compiler of any custom server control added to the
(B) What’s the use of SmartNavigation property ?
It’s a feature provided by ASP.NET to prevent flickering and redrawing when the page is
Note:- This is only supported for IE browser.Project’s who have browser compatibility as
requirement have to think some other ways of avoiding flickering.
(B) What is AppSetting Section in “Web.Config” file ?
Web.config file defines configuration for a webproject.Using “AppSetting” section we can
define user defined values.Example below defined is “ConnectionString” section which
will be used through out the project for database connection.
(B) Where is ViewState information stored ?
In HTML Hidden Fields.
(I) What’s the use of @ OutputCache directive in ASP.NET?
It’s basically used for caching.See more for Caching chapter.
(B) How can we create custom controls in ASP.NET ?
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 <%@ Register directive.Example
<%@ Register tagprefix="Accounting" Tagname="footer" Src="Footer.ascx" %>
√ Now to use the above accounting footer in page you can use the below directive.