473,626 Members | 3,083 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 17 '05 #1
5 24576
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*********@gm ail.com> wrote in message
news:OM******** ******@TK2MSFTN GP12.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*********@gm ail.com> wrote in message
news:OM******** ******@TK2MSFTN GP12.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(Sys tem.EventArgs e)
{
// PreRender code
base.OnPreRende r();
}

or
this.PreRender += new System.EventHan dler(Page_PreRe nder);

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******** *******@TK2MSFT NGP12.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*********@gm ail.com> wrote in message
news:OM******** ******@TK2MSFTN GP12.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*********@gm ail.com> wrote in message
news:OM******** ******@TK2MSFTN GP12.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(Sys tem.EventArgs e)
{
// PreRender code
base.OnPreRende r();
}

or
this.PreRender += new System.EventHan dler(Page_PreRe nder);

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******** *******@TK2MSFT NGP12.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*********@gm ail.com> wrote in message
news:OM******** ******@TK2MSFTN GP12.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
2946
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 clicked it updates a downloadcounter I have made. All works fine except it wont update the textlabel that shows the current number of the counter. If I refresh the page, it updates. I know that i can use onPreRender in a way...but I am wondering if...
3
2424
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. First I tried adding the controls and the event handlers for my control in the Initialize Components method of my page in the hopes that it would fire the event before the
5
4159
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 the code I use to add the User controll Control Component1 = null;
1
1586
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 the OnPreRender method. Is there a way for that. Can i manually tell asp.net page to check again if there is control that is post backing to the server. ex: Load IPostBackEventHandler.RaisePostBackEvent ( in this phase parameter is
4
2089
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
1567
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 view state variable, however i am told that the page has already been rendered at this point, what do i need todo to make my page "rerender" with the new viewstate information?
3
9664
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) UC2....NOTHING
1
1583
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 the OnClick event, the OnPreRender runs!!! I don't get it. I've never seen this behaviour before. Does anyone have any ideas??? here's part of the class... namespace mynamespace { /// <summary>
6
1781
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 controls depending on their whim and the day. In this case, they want to support FreeTextBox and Cute Editor interchangably. I've been trying to put together a container control derived from
0
8259
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8637
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8358
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7188
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6119
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5571
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4195
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1805
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1504
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.