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

Found a use for Page_Unload

I found a use for Page_Unload event method... here is the scenario:

1. Page.aspx has DoStuff.ascx in it.
2. DoStuff.ascx has a button that updates child control label lbXml
depending on user choices on input controls inside DoStuff.ascx.
3. But page.aspx, whats to know what is stored in lbXml so it can
process its own logic.

problem:

when page.aspx request lbXml.Text content inside DoStuff.ascx, using
DoStuff's public method DoStuff_ascx.GetlbXml(), it surely gets the
content, but the content was from the previous page download, because
most of the time, the button event handler inside DoStuff_ascx has not
yet executed...

Solution:

Put DoStuff_ascx.GetlbXml inside page.aspx's Page_Unload. page_Unload
runs the last...

Worry:

What is page_unload really for? I feel this is some kind of a hack...
or workaround... Is there a danger for doing this???

Let me know....

Nov 22 '05 #1
0 936

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

Similar topics

0
by: tascien | last post by:
I found a use for Page_Unload event method... here is the scenario: 1. Page.aspx has DoStuff.ascx in it. 2. DoStuff.ascx has a button that updates child control label lbXml depending on user...
1
by: Robert Scheer | last post by:
Hi. Debugging one of my pages I noticed that everytime I call the page, the first event to run is Page_Load and after it the Page_Unload. If I postback to the page the Page_Unload runs again....
19
by: Heidi Hundåla | last post by:
Hi ! I have a Wep App in C#. Page_Unload fires after Page_Load, and it seems totally unreasonable when you want to use this event when you _leave_ the page. In my project we wanted to use...
4
by: Larry Morris | last post by:
The following code, pasted into a web form with a link button on it, will cause the page_unload event to fire twice. If I remove the response.redirect, the problem goes away :). I've got a work...
3
by: Andrew Vickers | last post by:
Hi, I'm just trying to manually add a page_unload function in my code-behind module, but with no success. Can anyone help me with the correct syntax to add the function to my code? I've tried...
0
by: chefo | last post by:
Well, the subject describes my problem quite well :-) Here is some additional information. I use a common base class for all the pages in my project. It is derived from Page and it is not...
0
by: JeffM | last post by:
This seems odd, but it appears that the Page_Unload event is fired twice on a Response.Redirect or a Server.Transfer. The output below demonstrates that during the move from the first to the 2nd...
7
by: Cenk | last post by:
Hi, After converting my projects to ASP.Net 2.0 I have seen a problem with Page_unload. Ä°n framework 1.1 page_unload event fires when you are leaving the page or has closed the browser window....
0
by: Stina | last post by:
I have a problem with the Page_Unload event being called twice in a row on a redirect and I just can't figure out why. I have seen other threads on this subject but not found a solution to the...
2
by: RAM | last post by:
Hello, I am learning .NET 2.0 and I have written simple application with Default.aspx page and logging in Logon.aspx/Logon.aspx.cs. After Page_Unload of Logon.aspx.cs (I have checked by debugging)...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.