Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / August 2007

Tip: Looking for answers? Try searching our database.

Pre_Init

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike - 31 Aug 2007 14:18 GMT
protected void Page_PreInit(object sender, EventArgs e)

{

TextBox1.Text = TextBox1.GetType().ToString();

}

In the Pre_Init event of the page, I can set the value of say a TextBox's
Text property, but the TextBox isn't created until the Init event.  Also I
noticed while debugging that 'The name 'x' does not exist in the current
context' appears if I set a breakpoint just after setting the TextBox.Text
value.

If I try to reference a control that doesn't exist after the Init event, I
get a runtime error.  Why don't I get one in the Pre_init example above?

Mike
bruce barker - 31 Aug 2007 16:23 GMT
the controls defined on the aspx page are created at
FrameworkInitialize, which is well before PreInit.

-- bruce (sqlwork.com)

> protected void Page_PreInit(object sender, EventArgs e)
>
[quoted text clipped - 14 lines]
>
> Mike
Mike - 31 Aug 2007 17:00 GMT
Do you know, in all the Page Life Cycle articles I have read, I've never
seen FrameworkInitialize mentioned.

Thank you.

> the controls defined on the aspx page are created at FrameworkInitialize,
> which is well before PreInit.
[quoted text clipped - 20 lines]
>>
>> Mike

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.