473,320 Members | 1,854 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....

Sep 22 '05 #1
0 1417

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

Similar topics

3
by: James Hawthorne | last post by:
Hi, I have created a asp.net web application and I hooked up page_unload so I can clean up some things when i close it down. The problem is, page_unload gets called when I first load the page, not...
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....
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: 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...
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...
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)...
5
by: =?Utf-8?B?Um9sYW5kcGlzaA==?= | last post by:
Hi there, I'm using Web Developer Express 2005 in my ASP.NET learning. I tried creating a simple aspx page using "code-behind" approach. I noticed that protected void Page_Load event method...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
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: 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...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.