469,626 Members | 883 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,626 developers. It's quick & easy.

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 1318

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

3 posts views Thread by James Hawthorne | last post: by
1 post views Thread by Robert Scheer | last post: by
4 posts views Thread by Larry Morris | last post: by
3 posts views Thread by Andrew Vickers | last post: by
reply views Thread by chefo | last post: by
reply views Thread by tascien | last post: by
5 posts views Thread by =?Utf-8?B?Um9sYW5kcGlzaA==?= | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.