A
Alex Maghen
I have a UserControl with a single constituent DropdownList control. My
control takes 2 important properties:
Property 1: "ListSource" is a key in a database for pulling out the list
that will populate the contents of the DropdownList.
Property 2: "SelectedValue" is the actual selected Value in the DropdownList.
Here's my problem: If the lifecycle of the page that uses my control, I'm
noticing that things happen in the following order:
a. The page's Page_Load() happens
b. My control's SelectedValue.Set property is called
c. My control's Page_Load() happens
Now, here's the problem with that: In my control, the process that causes
the contituent DropdownList to get populated with items ocurrs in the
control's Page_Load() event. As a result, the parent page is trying to set my
control's SelectedValue property BEFORE the control has been populated and,
therefore, it fails.
Now, theoretically, I'd want to popultae my control's items at some other
time in the life-cycle, but the problem is that I can't do that populating
until I get the design-time property, "ListSource" which tells me how to
populate it.
Can you help me figure out how I can gain access to these design-time
properties and populate my control *before* the Page_Load of the parent page
ocurrs?
Thanks.
Alex
control takes 2 important properties:
Property 1: "ListSource" is a key in a database for pulling out the list
that will populate the contents of the DropdownList.
Property 2: "SelectedValue" is the actual selected Value in the DropdownList.
Here's my problem: If the lifecycle of the page that uses my control, I'm
noticing that things happen in the following order:
a. The page's Page_Load() happens
b. My control's SelectedValue.Set property is called
c. My control's Page_Load() happens
Now, here's the problem with that: In my control, the process that causes
the contituent DropdownList to get populated with items ocurrs in the
control's Page_Load() event. As a result, the parent page is trying to set my
control's SelectedValue property BEFORE the control has been populated and,
therefore, it fails.
Now, theoretically, I'd want to popultae my control's items at some other
time in the life-cycle, but the problem is that I can't do that populating
until I get the design-time property, "ListSource" which tells me how to
populate it.
Can you help me figure out how I can gain access to these design-time
properties and populate my control *before* the Page_Load of the parent page
ocurrs?
Thanks.
Alex