(B) What’s the sequence in which ASP.NET events are processed ?
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 insubsequent 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 inPage_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 postedback.
(A) What is event bubbling ?
Server controls like Datagrid , DataList , Repeater can have other child controls insidethem.Example DataGrid can have combo box inside datagrid.These child control do not raisethere events by themselves , rather they pass the event to the container parent (which can bea datagrid , datalist , repeater) , which passed to the page as “ItemCommand” event.As thechild 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 withViewState , 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 page.
(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 postedback.Note:- This is only supported for IE browser. Project’s who have browser compatibility asrequirement 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 defineuser defined values.Example below defined is “ConnectionString” section which will be usedthrough out the project for database connection.
<configuration><appSettings><add key="ConnectionString" value="server=xyz;pwd=pw;database=test" /></appSettings>
(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 twothings in order that the ASCX can be used in project:.√ Register the ASCX control in page using the <%@ Register directive.Example