ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  ASP.NET
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions
 C Sharp interview questions  C Sharp Interview Questions
 ASP.NET interview questions  ASP.NET Interview Questions
 VB.NET interview questions  VB.NET Interview Questions
 COM+ interview questions  COM+ Interview Questions
 ADO.NET interview questions  ADO.NET Interview Questions
 IIS interview questions  IIS Interview Questions
 MTS interview questions  MTS Interview Questions
 Crystal Reports interview questions  Crystal Reports Interview Questions
 BizTalk interview questions  BizTalk Interview Questions
 Dot Net interview questions  Dot Net Interview Questions
 Exchange Server interview questions  Exchange Server Interview Questions
 SharePoint interview questions  SharePoint Interview Questions
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions
Question
What is pre-init event in ASP.NET 2.0 page life cycle?
 Question Submitted By :: Kiran
I also faced this Question!!     Rank Answer Posted By  
 
  Re: What is pre-init event in ASP.NET 2.0 page life cycle?
Answer
# 1
PreInit()
In this Page level event, all controls created during 
design time are initialized with their default values. For 
e.g., if you have a TextBox control with Text property 
= “Hello”, it would be set by now. We can create dynamic 
controls here. 

This event occurs only for the Page class and 
UserControls/MasterPages do not have this method to 
override. 

Sample code where you can override this method and add your 
custom code:


protected override void OnPreInit(EventArgs e)
        
{
            //custom code            
           base.OnPreInit(e);
 }
Note that PreInit() is the only event where we can set 
themes programmatically. 

Special Case with MasterPages 

It is important to note that Master Page is treated like a 
control in the Content Pages.
So if a Page has a  Master Page associated with it, then 
the controls on the page will not be initialized and would 
be null in this stage. Only after the Init() event starts, 
you can access these controls directly from the page class. 
Why? 

The reason being that all controls placed in the Content 
Page are within a ContentPlaceholder which is a child 
control of a MasterPage. Now Master Page is merged and 
treated like a control in the Content Pages. As I mentioned 
earlier, all events except the Init() and Unload() are 
fired from outermost to the innermost control. So PreInit() 
in the Page is the first event to fire but User Controls or 
MasterPage (which is itself a Usercontrol) do not have any 
PreInit event . Therefore in the Page_PreInit() method, 
neither the MasterPage nor any user control has been 
initialized and only the controls inside the Page class are 
set to their default values. Only after the Page_PreInit() 
event the Init() events of other controls fire up.

 
Is This Answer Correct ?    19 Yes 1 No
Ashutosh Tripathi
 

 
 
 
Other ASP.NET Interview Questions
 
  Question Asked @ Answers
 
Explain Generics?  1
Caching techniques in .NET ? Microsoft1
User contro having 4 text boxes given validation controls. i want to execute validations after the button click event how it is?  3
What is .Net3.0 and .Net3.5? Describe something about that Features..  1
is it possible to access website from a remote place, without deploying it on web server?  1
How to send auto matic emails based on scheduled tasks to several of my clients  6
Explain what a diffgram is and a good use for one? Syntax-Softtech1
Types of optimization and name a few and how do u do? Accenture1
what is profiles in asp.net  1
Suppose you want a certain ASP.NET function executed on MouseOver over a certain button. Where do you add an event handler?  1
how to increase performance of web site? if there is a page with high load. the content is high then what should we do to increase performance? TCS2
Describe the role of inetinfo.exe, aspnet_isapi.dll andaspnet_wp.exe in the page loading process.  1
When is the ViewState available during the page processing cycle ?  3
Explain the life cycle of an ASP .NET page.  2
What does the "EnableViewState" property do? Why would I want it on or off?  4
When working with ASP.Net server controls, it is important to use the right event handlers to capture the event for the application to function properly. What event would you use to capture the selection of a new item in a DropDownList control? a) The Click event. b) The SelectionChanged event. c) The SelectionIndexChanged event. d) The ChangedSelection event. Syntax-Softtech4
What is three major points in WCF?  4
About remoting and web services. Difference between them? Microsoft2
Which keyword you should use for class not to extend? Which keyword to be used for making the class accessible within the assembly only what are the authentication mode of ASP.NET How will you call a JavaScript function using code-behind? How will you define the Session Timeout? What are the methods to validate client-side whether the input is a correct Date format? You want to write a log when ASP.NET application starts. Which is the best place to write that peice of code? What are the page load events and what is there order? What is the difference between abstract class and interface? What are the differences between DataSet and DataReader? What are the two properties other than DataSource, which is required to populate the Drop Down Menu? What is difference between String and StringBuilder Classes? What are differences between Custom control and User control? Ignis-Technologies1
Features of a dataset ? Accenture3
 
For more ASP.NET Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com