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

PreRender event

Joe
Hello All:

I have been bitten a few times lately as I've tried to implement
functionality in the Page_PreRender event.

So here is my question: for what purpose do you use the PreRender event?
How do you decide whe to use the PreRender event vs the Unload event?

Any respnse will be welcome.

TIA,
--
Joe
Mar 29 '06 #1
2 2048
Joe,

PreRender is good for formatting the items, calculating totals. You can loop
through the whole collection of items as opposed to the ItemDataBound event
that handles an item at the time.

In the Unload event the items are already gone to the client.

Eliyahu

"Joe" <Jo*@discussions.microsoft.com> wrote in message
news:1C**********************************@microsof t.com...
Hello All:

I have been bitten a few times lately as I've tried to implement
functionality in the Page_PreRender event.

So here is my question: for what purpose do you use the PreRender event?
How do you decide whe to use the PreRender event vs the Unload event?

Any respnse will be welcome.

TIA,
--
Joe

Mar 29 '06 #2
Joe
So, basically, in the PreRender event, since evenything is on the page, I'm
just cleaning up what's there. And since the Unload event occurs after the
page has been sent, I can use it to clean up a database connection or
something else that occurred on the server.

Sound good?
--
Joe
"Eliyahu Goldin" wrote:
Joe,

PreRender is good for formatting the items, calculating totals. You can loop
through the whole collection of items as opposed to the ItemDataBound event
that handles an item at the time.

In the Unload event the items are already gone to the client.

Eliyahu

"Joe" <Jo*@discussions.microsoft.com> wrote in message
news:1C**********************************@microsof t.com...
Hello All:

I have been bitten a few times lately as I've tried to implement
functionality in the Page_PreRender event.

So here is my question: for what purpose do you use the PreRender event?
How do you decide whe to use the PreRender event vs the Unload event?

Any respnse will be welcome.

TIA,
--
Joe


Mar 29 '06 #3

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

Similar topics

1
by: Alireza Ziai | last post by:
I have problem with prerender event in my page I dont know why prerender event occurs immediatley after Load event , I have same problem with Unload event too ,is it a problem with framework or sth ?
1
by: DalePres | last post by:
Does anyone know if there is a known bug or workaround, or other solution to this problem? I have a page with several imagebutton server controls and needed to handle the PreRender event in C#....
0
by: wardy | last post by:
I've got a .NET web application running in .NET 1.1 on IIS 5 with SQL Server 2000. I've noticed that at times the page rendering is delayed, and when I run the trace I see that the begin prerender...
7
by: wardy | last post by:
Hi, I'm hoping someone can lend me a hand....I've got a .NET Web app running on Windows 2000 IIS 5.0 linking to a SQL Server 2000 database. When the database is located on the same server as the...
0
by: Selden McCabe | last post by:
I have a base page class, from which all pages in my project inherit. In the base page prerender event, I would like to know which page is being loaded. But when I do this.ID, it return null. ...
3
by: Matt Jensen | last post by:
Howdy all - and seasons greetings Just wondering, I've recently discovered the PreRender event for .NET (both for the page and for controls), which seems like a life saver for doing page data...
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)...
2
by: =?Utf-8?B?WWFua2VlIEltcGVyaWFsaXN0IERvZw==?= | last post by:
i'm not sure how the preRender event gets handled. if i have a function: protected void tbPasswordPreRender(object sender, EventArgs e) { tbPswd1.Attributes = tbPswd1.Text; tbPswd2.Attributes...
0
by: tshad | last post by:
In VS 2008, I have 2 pages, one aspx page and one ascx page. The PreRender event is not firing on the Contol page. The aspx page starts out: <%@ Page Language="VB" AutoEventWireup="true"...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.