free classified ads and leads
domain website price


ASP.NET Interview Questions Part-1

Languages and Programming

ASP.NET

Qus1 : ASP .Net Page Life Cycle.

Ans1 :

1. OnInit (Init) Initializes each child control of the current

2. LoadControlState: Loads the ControlState of the control. To use this method the control must call the Page.RegisterRequiresControlState method in the OnInit method of the control.

3. LoadViewState: Loads the ViewState of the control.

4. LoadPostData: Is defined on interface IPostBackDataHandler. Controls that implement this interface use this method to retrieve the incoming form data and update the control s properties accordingly.

5. Load (OnLoad): Allows actions that are common to every request to be placed here. Note that the control is stable at this time; it has been initialized and its state has been reconstructed.

6. RaisePostDataChangedEvent: Is defined on the interface IPostBackData-Handler. Controls that implement this interface use this event to raise change events in response to the Postback data changing between the current Postback and the previous Postback. For example if a TextBox has a TextChanged event and AutoPostback is turned off clicking a button causes the Text-Changed event to execute in this stage before handling the click event of the button which is raised in the next stage.

7. RaisePostbackEvent: Handles the client-side event that caused the Postback
to occur

8. PreRender (OnPreRender): Allows last-minute changes to the control. This
event takes place after all regular Post-back events have taken place. This event takes place before saving ViewState so any changes made here are saved.

9. SaveControlState: Saves the current control state to ViewState. After this stage any changes to the control state are lost. To use this method the control must call the Page.RegisterRequiresControlState method in the OnInit method of the control.

10. SaveViewState: Saves the current data state of the control to ViewState. After this stage any changes to the control data are lost.

11. Render: Generates the client-side HTML Dynamic Hypertext Markup Language (DHTML) and script that are necessary to properly display this control at the browser. In this stage any changes to the control are not persisted into ViewState.

12. Dispose: Accepts cleanup code. Releases any unman-aged resources in this stage. Unmanaged resources are resources that are not handled by the .NET common language runtime such as file handles and database connections.

13. UnLoad: Set of subprograms that are executed towards each time of web page processing are called page life cycle events

14. Page Preinit: This will be executed before memory initialization for web page [before constructing web page.

Attaching theme master page dynamically to webpage is possible using preinit event proc.

15. Page init: This will be executed when memory is initialized for webpage

16. Page load: This will be executed when submitted data and controls are loaded. Database connectivity reading submitted data can be placed within pageload

17.PagePrerender: This will be executed before rendering html content from server side control

Control behaviour can be changed b4 producing client side contro.

18. Page Unload: This will be executed once memory is released for webpage.

Closing database connection.

Qus2: Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process.
Ans
:
inetinfo.exe is theMicrosoft IIS server running, handling ASP.NET requests among other things.When an ASP.NET request is received (usually a file with .aspx extension), the ISAPI filter aspnet_isapi.dll takes care of it by passing the request tothe actual worker process aspnet_wp.exe.

Qus3: What methods are fired during the page load?
Ans: Init() - when the page is instantiated.
Load() - when the page is loaded into server memory.
PreRender() - the brief moment before the page is displayed to the user as HTML.
Unload() - when page finishes loading.

Qus4: When during the page processing cycle is ViewState available?
Ans: After the Init() and before the Page_Load(), or OnLoad() for a control.

Qus5: What namespace does the Web page belong in the .NET Framework class hierarchy?
Ans: System.Web.UI.Page

Qus6: Where do you store the information about the user’s locale?
Ans:System.Web.UI.Page.Culture

Qus7: What’s the difference between Codebehind="MyCode.aspx.cs" andSrc="MyCode.aspx.cs"?
Ans: CodeBehind is relevant to Visual Studio.NET only.

Qus8: What’s a bubbled event?
Ans: When you have a complex control, like DataGrid, writing an event processing routine for each object (cell, button, row, etc.) is quite tedious. The controls can bubble up their eventhandlers, allowing the main DataGrid event handler to take care of its constituents.

Qus9: Suppose you want a certain ASP.NET function executed on MouseOver for a certain button. Where do you add an event handler?
Ans: Add an OnMouseOver attribute to the button. Example: btnSubmit.Attributes.Add("onmouseover","someClientCodeHere();");

Qus10: What data types do the RangeValidator control support?
Ans: Integer, String, and Date.
Bookmark and Share




Gallery

Related Topics

Comments

Me and this article, sitting in a tree, L---IER-N-A-N-G!
Reviewed By : , Date : 08-04-2017, Rated :


Submit Reviews:


(Enter the characters seen on the image below.)



Promotional Ads

Advertisement

Packers and movers in Mohali
Plot No 636, Near HP Gas Agency, Dariya, Chandigarh - 160101
Mohali

Submersible Sludge Pumps
18, shreenath Estate, cross road, nr. Nikol, nr. Sardar Patel Ring Road, Kathwada, Gujarat 382415
Ahmedabad

Bhakti Bird Proofing
House no.9479 durgamata tekdi vibhag, mahalaxmi nagar, City ambernath, Near durgamata temple. Pin Code-421501
Motilal Nagar Mumbai

Livonta Global Pvt.Ltd
1110, Colonnade, B/H Iscon Temple, Opp. Iscon BRTS Bus Stand
Iscon - Ambali Rd,
Ahmedabad

Brij Agnihotri & associates company secretaries
3454, 40D, Sector 40D, Chandigarh, 160036, India

JB Rock Bolts & SN BOLTS
10 A & B Industrial Area (at Vill. Nangal Jarialan)
Distt. Una Himachal Pradesh
Una

Govinda resorts Lonavala
Old Mumbai - Pune Hwy, Maval, Lonavala, Maharashtra 410405
Lonavla

Steelco Metal & Alloys
192 – Minara Mansion, Shop No.6, Sant Sena Maharaj Marg, 2nd Kumbharwada Lane, Mumbai, Maharashtra 400004
Mumbra Mumbai

Best Resorts in Dharamshala Amid the Misty Hills.
SATOBARI HILLS ROAD,MCLEODGANJ,
Dharamshala

Genius Global School
194 Anand Vihar Saproon, Solan, Himachal Pradesh
Ambala Cantt