473,407 Members | 2,314 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,407 software developers and data experts.

Pre_Init

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
Aug 31 '07 #1
2 2525
the controls defined on the aspx page are created at
FrameworkInitialize, which is well before PreInit.

-- bruce (sqlwork.com)

Mike wrote:
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

Aug 31 '07 #2
Do you know, in all the Page Life Cycle articles I have read, I've never
seen FrameworkInitialize mentioned.

Thank you.
"bruce barker" <no****@nospam.comwrote in message
news:%2******************@TK2MSFTNGP04.phx.gbl...
the controls defined on the aspx page are created at FrameworkInitialize,
which is well before PreInit.

-- bruce (sqlwork.com)

Mike wrote:
>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
Aug 31 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: maxime | last post by:
Hi, I try to develop a game in python and pygame. In my game I play a music (.mid with pygame.mixer.music) but sometime I need to accelerate it but I don't see how to do that with pygame. Is it...
2
by: Parag C Mehta | last post by:
Hi, We are exploring the new possiblities in ASP.NET v2.0. I want to have a page, in this page I have one WebPartManager 3 zones and I want to dynamically add WebParts to 3 zones. I chose...
5
by: annagel | last post by:
I am looking for a way to force a Tkinter window into focus on a system level. I know the force focus method should bring one window of my application into focus, but it seems I need to have some...
2
by: Michael | last post by:
Hi, I'm using ASP.NET 2.0. I have code like: protected void Page_PreInit(object sender, EventArgs e) { // do something } The Page_PreInit is not firing. Is it supposed to work for User...
0
by: Giovanni | last post by:
I was wondering if someone would be able to help me with the following: Simply put, I have built an ASP.NET 2.0 WebUserControl (UC1). UC1 contains: A GridView which is bound to an SQLDataSource...
4
by: sck10 | last post by:
Hello, Currently I am using the following: <%@ Page Language="VB" StylesheetTheme="Default" MasterPageFile="~/template/mpColumn02.master" CodeFile="custrev.aspx.vb" Inherits="custrev"...
21
by: Edward | last post by:
Hi All, I feel frustrated with one of my Customers who wants me to ensure that a dotnet web site I am building for them must be compatible to Apple's Safari browser! Safari is buggy and it...
6
by: Rahul | last post by:
this is my code in preinit event I have "hlinkAdd" as hyperlink web control and i am using a master page, and below code is of content page preinit event. Protected Sub Page_PreInit(ByVal sender...
2
by: Woot4Moo | last post by:
Hey guys I am running Windows XP and am having an issue with a game that my team has created. Whenever an audio file is played it creates a very distorted, crackly sound. Any ideas what could be...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.