473,499 Members | 1,747 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

OnPreRender ??? What is ?

Hi, i'd like to know more abou this event, i tryed to found in MSDN but the
explanation is null for me...is there some explanation when and how should i
use it ?
Nov 19 '05 #1
4 2080
Pre-render isn't an event, it's a "stage" that a page instance goes through
Page_Init and Page_Load both occur during this stage.
"Daniel Groh" <ne*********@gmail.com> wrote in message
news:OM**************@TK2MSFTNGP12.phx.gbl...
Hi, i'd like to know more abou this event, i tryed to found in MSDN but
the explanation is null for me...is there some explanation when and how
should i use it ?

Nov 19 '05 #2
OnPreRender is indeed an event raised as part of the page life-cycle. The
page's OnPreRender method may be overridden or a delegate may be used to
define an Event Handler in a manner similar to Page_Load and Page_Init.

[C#]
protected override void OnPreRender(System.EventArgs e)
{
// PreRender code
base.OnPreRender();
}

or
this.PreRender += new System.EventHandler(Page_PreRender);

OnPreRender is typically used for handling some last minute tasks such as
enabling or disabling controls or modifying other content after control
events have been handled but before the viewstate is saved and the HTML is
rendered [generated].

I'll refer you to
http://msdn.microsoft.com/library/de...bjectmodel.asp
for more information about the life cycle of an ASP.NET page.

HTH
----------------
Dave Fancher
http://www.davefancher.com

"Scott M." <No****@NoSpam.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Pre-render isn't an event, it's a "stage" that a page instance goes
through Page_Init and Page_Load both occur during this stage.
"Daniel Groh" <ne*********@gmail.com> wrote in message
news:OM**************@TK2MSFTNGP12.phx.gbl...
Hi, i'd like to know more abou this event, i tryed to found in MSDN but
the explanation is null for me...is there some explanation when and how
should i use it ?


Nov 19 '05 #3
just to say what Dave has said in another way (this from a ref book) "The
PreRender event is raised just before the page is about to render its
contents. This is the last chance to modify a page output before it is sent
to the browser".
"Daniel Groh" <ne*********@gmail.com> wrote in message
news:OM**************@TK2MSFTNGP12.phx.gbl...
Hi, i'd like to know more abou this event, i tryed to found in MSDN but
the explanation is null for me...is there some explanation when and how
should i use it ?

Nov 19 '05 #4
OnPreRender is NOT the event, it's the method that raises the PreRender event.

and scott, Page_Load and Page_Init do NOT get called during the PreRender
phase. They are event handlers wired up to the Load and Init events
respectively.

PreRender is the last place you can change your control states before Render
is called recursively to generate the HTML output of a page. If you do a lot
of custom server controls, this is typically where you would register client
side javascripts among other things.

"Dave Fancher" wrote:
OnPreRender is indeed an event raised as part of the page life-cycle. The
page's OnPreRender method may be overridden or a delegate may be used to
define an Event Handler in a manner similar to Page_Load and Page_Init.

[C#]
protected override void OnPreRender(System.EventArgs e)
{
// PreRender code
base.OnPreRender();
}

or
this.PreRender += new System.EventHandler(Page_PreRender);

OnPreRender is typically used for handling some last minute tasks such as
enabling or disabling controls or modifying other content after control
events have been handled but before the viewstate is saved and the HTML is
rendered [generated].

I'll refer you to
http://msdn.microsoft.com/library/de...bjectmodel.asp
for more information about the life cycle of an ASP.NET page.

HTH
----------------
Dave Fancher
http://www.davefancher.com

"Scott M." <No****@NoSpam.com> wrote in message
news:%2***************@TK2MSFTNGP12.phx.gbl...
Pre-render isn't an event, it's a "stage" that a page instance goes
through Page_Init and Page_Load both occur during this stage.
"Daniel Groh" <ne*********@gmail.com> wrote in message
news:OM**************@TK2MSFTNGP12.phx.gbl...
Hi, i'd like to know more abou this event, i tryed to found in MSDN but
the explanation is null for me...is there some explanation when and how
should i use it ?



Nov 19 '05 #5

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

Similar topics

0
2933
by: Svein Erik Storkaas | last post by:
Hi, I have a page that has 1 textbox, 1 button and 1 label. It is a page where you have to write your email address, then you can click on the button to download a program. When the button is...
5
24563
by: Daniel Groh | last post by:
Hi, i'd like to know more abou this event, i tryed to found in MSDN but the explanation is null for me...is there some explanation when and how should i use it ?
3
2411
by: Kenton Smeltzer | last post by:
Hello All, I am having a problem with events and the addition of controls on a page I am developing. First let me tell you what I have tried and then maybe someone can see something I missed. ...
5
4150
by: Flare | last post by:
(ASP.NET 1.1) Hi I have a problem with my ViewStates in a userControl. The problem is that the ViewState is not "writte" og changed if you like after editing in my case a textbox. This is...
1
1577
by: Umut Tezduyar | last post by:
Because of the fact that, handling events method ( IPostBackEventHandler.RaisePorstBackEvent method) is prior to OnPreRender method, i cannot handle the events of the controls that i am adding on...
1
1646
by: Christophe Peillet | last post by:
I have a CompositeControl with two types of properties: 1.) Mapped Properties that map directly to a child control's properties (ex.: this.TextboxText = m_txt.Text). These properties are handled...
3
1558
by: Tarun Mistry | last post by:
Hi everyone. I have a usercontol that changes one of the ViewState variables, it does this when a button within it is pressed. I would like to alter the appearance of the page based on this...
3
9653
by: John Scott | last post by:
Hey I've got an odd problem here. I have two user controls on a single page. Here is the flow of my page Page(OnLoad) UC1(OnPreRender) UC2(OnPreRender) Page(ButtonClick) UC1(OnPreRender)...
1
1572
by: 2310b | last post by:
I have a web form in which i use OnPreRender to load controls. it works fine BUT no matter what other events I call, the OnPreRender keeps executing. If I click on one of the buttons to fire off...
6
1769
by: =?Utf-8?B?TWFyaw==?= | last post by:
Hi... Tried posting this on Build Controls but then saw that's a pretty slow group... Kind of a typical request from product management - they want to be able to swap in different 3rd party...
0
7012
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
7180
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
7225
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...
1
6901
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
7392
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4920
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...
0
4605
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3101
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
307
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.