PreRender event

G

Guest

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,
 
E

Eliyahu Goldin

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
 
G

Guest

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top