473,416 Members | 1,660 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,416 software developers and data experts.

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 17 '05 #1
5 24555
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 17 '05 #2
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 17 '05 #3
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 17 '05 #4
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 17 '05 #5
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 17 '05 #6

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

Similar topics

0
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...
3
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
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
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...
4
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
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
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
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
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
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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...
0
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...

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.