A
AC [MVP MOSS]
To start, this is for use within a SharePoint v3 site, but the concept is
really core ASP.NET 2.0 development, so after striking out, I'm hoping
someone here has an idea... thinking I'm having a core page lifecycle issue
here...
Creating a control that contains a DDL for countries, DDL for states & TXB
for regions. If the user selects USA, the stateDDL should be visible and the
TXB should be hidden... otherwise vice versa. Pretty simple. However, what's
challenging here is that the control doesn't load like you're used to (ASCX
then code behind with auto wireup). Rather, the class is loaded first and
contains a property that tells the framework which ASCX to load. Once loaded,
the CreateChildControls() is fired where you can get references to the
controls on the page. No problem so far.
Problem though is that when the event handler for the
DDL_SelectedIdexChanged event is raised, it ~always~ says the selected index
is 0. Tracing the code, the CreateChildControls() method runs first, THEN the
event haldner runs... as expected... but the viewstate should have been
parsed and the value should have been set on the DDL... but it isn't.
Ideas?
really core ASP.NET 2.0 development, so after striking out, I'm hoping
someone here has an idea... thinking I'm having a core page lifecycle issue
here...
Creating a control that contains a DDL for countries, DDL for states & TXB
for regions. If the user selects USA, the stateDDL should be visible and the
TXB should be hidden... otherwise vice versa. Pretty simple. However, what's
challenging here is that the control doesn't load like you're used to (ASCX
then code behind with auto wireup). Rather, the class is loaded first and
contains a property that tells the framework which ASCX to load. Once loaded,
the CreateChildControls() is fired where you can get references to the
controls on the page. No problem so far.
Problem though is that when the event handler for the
DDL_SelectedIdexChanged event is raised, it ~always~ says the selected index
is 0. Tracing the code, the CreateChildControls() method runs first, THEN the
event haldner runs... as expected... but the viewstate should have been
parsed and the value should have been set on the DDL... but it isn't.
Ideas?