Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Issues with DDL postback on dynamically loaded ASCX

Reply
Thread Tools

Issues with DDL postback on dynamically loaded ASCX

 
 
AC [MVP MOSS]
Guest
Posts: n/a
 
      09-24-2007
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?

--
-AC [MVP MOSS]
http://www.andrewconnell.com
http://www.andrewconnell.com/mvp
http://www.andrewconnell.com/blog

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASCX User Controls and DDL.SelectedValue runtoofar@gmail.com ASP .Net Web Controls 2 10-19-2005 05:53 PM
Are dynamically loaded controls preserved over a postback? Alan Silver ASP .Net 6 08-09-2005 08:54 AM
dynamically loaded control event only reached on 2nd postback kw ASP .Net 5 07-16-2004 09:33 PM
Re: Problems with PostBack events when swapping dynamically loaded controls in a page Peter Jaffe ASP .Net 0 02-04-2004 12:06 PM
Re: Persisting DDL.SelectedValue or DDL.SelectedItem.Value without Viewstate Marina ASP .Net 0 08-12-2003 07:08 PM



Advertisments