473,750 Members | 2,253 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2065
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*@discussion s.microsoft.com > wrote in message
news:1C******** *************** ***********@mic rosoft.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*@discussion s.microsoft.com > wrote in message
news:1C******** *************** ***********@mic rosoft.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
1835
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
2496
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#. In all my tests, on several pages and circumstances, the Init and PreRender events never fire for the image button. If I add a regular button server control, or several regular button server controls, and the PreRender and Init events fire as...
0
1568
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 event takes anywhere from 0.2-5.0 seconds, whereas all the other events take in the range of 0.000XX seconds. Does anyone know what is happening in the begin prerender event that might be causing this delay (as a note, I've found that when I...
7
4943
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 web app, the pages render quickly - however, when I run the app with the database on its own server, the page rendering takes anywhere from 5-8 seconds, and when I enable tracing on the application, it appears to be the begin prerender event that...
0
942
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. How can I determine the page ID during prerender? Thanks! ---Selden
3
8116
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 loads that need to occur AFTER event handlers have fired, as well as after page load and postback. Is this good, bad or common practice? example I've got a repeater on the page, and in the header of the repeater I've got
3
9667
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
2
2978
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 = tbPswd2.Text; } and set the two text boxes Prerender event to this single function will it fire twice?
0
1869
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" Trace="true" CodeFile="TakeSurveyTest.aspx.vb" Inherits="TakeSurveyTest" %> And the ascx page starts out:
0
8999
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
8836
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9394
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
9338
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
8260
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
6803
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
4712
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4885
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.