Ans:- 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.
Que:- In which event are the controls fully loaded ?
Ans:- 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.
Que:- How can we identify that the Page is PostBack ?
Ans:- Page object has a “IsPostBack” property which can be checked to know that is the page posted back.
Que:-What is event bubbling ?
Ans:- 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.
Que:- If we want to make sure that no one has tampered with ViewState, how do we ensure it?
Ans:- Using the @Page directive EnableViewStateMac to True.
Que:- What is AppSetting Section in “Web.Config” file?
Ans:- 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.
Que:- Where is ViewState information stored ?
Ans:- In HTML Hidden Fields.
Que:- How can we create custom controls in ASP.NET ?
Ans:- 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
* Now to use the above accounting footer in page you can use the below directive.