Groups | Blog | Home
all groups > asp.net webcontrols > june 2003 >

asp.net webcontrols : Tricky Question: Page_Load


charles
6/30/2003 12:33:14 PM
You could take the code out of page_load and put it into page_prerender.
Then it will run after all your controls preload

[quoted text, click to view]

William F. Robertson, Jr.
6/30/2003 2:31:03 PM
You don't want to put any actually "processing" functionality into page
load. You should be doing any processing in an event such as a click, that
way all controls (both user and asp) have a chance to run their load event.
The data for the controls in the page_load isn't guaranteed to be up to
date.

HTH,

bill



[quoted text, click to view]

VB Programmer
6/30/2003 2:41:26 PM
I have a usercontrol that sets a public/shared variable called
"database_name". (User selects a dropdownlist of available databases.) A
webform (webform1), that uses this usercontrol, connects to the database
defined by that public variable and does stuff.

Problem: Webform1 is always one database "behind". This is because the
Page_Load runs on webform1, THEN Page_Load is run on the usercontrol (which
sets the database_name variable).

Any ideas how I can fix this/compensate?

Please assist.

Thanks,
Robert

VB Programmer
6/30/2003 4:03:31 PM
This worked GREAT! Thanks!

[quoted text, click to view]

AddThis Social Bookmark Button