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

Forum statistics

Threads
473,995
Messages
2,570,235
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top