ralphtrent
Programmer
Hi
I am using asp.net 2.0. I have an ASPX with 2 ASCX. In the first ASCX I have a form or selectables, in the second I have another form of selectables. In my ASPX, I accept a QueryString called Action, if that value is EDIT. then I need to put both ASCX's in edit mode (basically, just prefill the forms). in the first ASCX I read the querystring from the page and if it is EDIT then I proceed to prefill, that controls objects. I also attempt to prefile the objects in my second control with int he same code. So I need to search the page for the controls with in the ASCX to prefill them. That is all good, but the problem I am having is in the second ASCX my Page_Load is not firing until after I atempt to preload the objects. In the Page_Load of the second ASCX I prefill default values for a dropdownbox. But since the Page_Load is not firing, when I attempt to preselect a value from the dropdownbox, the values are not there, there for, not preselecting the correct value.
So, how do I make Page_Load code execute as soon as the page is loaded but before I do any prefilling. I have also added my Page_Load code to Page_Init and Page_PreRender.
I can supply code if helpful, but I just need to know the general idea. I can put the prefilling of the object in ASCX Page_Load, but I was trying to save a trip to the database to get the data again.
Any help is appreciated.
Thanks,
RalphTrent
I am using asp.net 2.0. I have an ASPX with 2 ASCX. In the first ASCX I have a form or selectables, in the second I have another form of selectables. In my ASPX, I accept a QueryString called Action, if that value is EDIT. then I need to put both ASCX's in edit mode (basically, just prefill the forms). in the first ASCX I read the querystring from the page and if it is EDIT then I proceed to prefill, that controls objects. I also attempt to prefile the objects in my second control with int he same code. So I need to search the page for the controls with in the ASCX to prefill them. That is all good, but the problem I am having is in the second ASCX my Page_Load is not firing until after I atempt to preload the objects. In the Page_Load of the second ASCX I prefill default values for a dropdownbox. But since the Page_Load is not firing, when I attempt to preselect a value from the dropdownbox, the values are not there, there for, not preselecting the correct value.
So, how do I make Page_Load code execute as soon as the page is loaded but before I do any prefilling. I have also added my Page_Load code to Page_Init and Page_PreRender.
I can supply code if helpful, but I just need to know the general idea. I can put the prefilling of the object in ASCX Page_Load, but I was trying to save a trip to the database to get the data again.
Any help is appreciated.
Thanks,
RalphTrent