Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Losing Dropdownlist viewstate

Reply
Thread Tools

Losing Dropdownlist viewstate

 
 
Dstl Web Team
Guest
Posts: n/a
 
      01-09-2004
Hi,

I am using the placeholder to dynamically create a new row in a table
that contains a dropdown list, a text box an a radio button on the
click of a button.

Thing is the previous view state of the controls is not kept each time
the button is clicked. A for loop is used to build each row and
increment the control ID's.

I've tried several fix suggestions from this NG such as IsNotPostBack
and adding the control properties after adding the control to the
placeholder but still no joy.

Every time the button is clicked the previous dropdowns revert to the
first in the list, the text boxs goes blank and reverts to a default
size and the radio buttons goes blank.

Im losing it. Please help

Kevin
 
Reply With Quote
 
 
 
 
Ken Cox [Microsoft MVP]
Guest
Posts: n/a
 
      01-10-2004
Hey Kevin,

Dynamically-added controls aren't persisted, so you have to recreate them on
each request.

It sounds like you need this free tool to handle that for you:

DynamicControlsPlaceholder

http://www.denisbauer.com/ASPNETCont...aceholder.aspx

Ken

"Dstl Web Team" <(E-Mail Removed)> wrote in message
news:3ffe97b3.6624859@146.80.9.44...
> Hi,
>
> I am using the placeholder to dynamically create a new row in a table
> that contains a dropdown list, a text box an a radio button on the
> click of a button.
>
> Thing is the previous view state of the controls is not kept each time
> the button is clicked. A for loop is used to build each row and
> increment the control ID's.
>
> I've tried several fix suggestions from this NG such as IsNotPostBack
> and adding the control properties after adding the control to the
> placeholder but still no joy.
>
> Every time the button is clicked the previous dropdowns revert to the
> first in the list, the text boxs goes blank and reverts to a default
> size and the radio buttons goes blank.
>
> Im losing it. Please help
>
> Kevin


 
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
Regex losing <br> (different from the earlier topic about losing $1) Jason C Perl Misc 4 06-26-2012 10:29 PM
Losing Drives - Finding Drives - Losing Drives mel@no.spam.com Computer Support 2 09-21-2007 10:16 PM
C# - Dynamically Creating Table - Losing ViewState =?Utf-8?B?R3JpZ3M=?= ASP .Net 4 11-19-2004 06:38 PM
Viewstate - load balance web site - Losing state Kevin C ASP .Net 1 10-20-2004 07:36 PM
How can I set the browser to refresh automatically without losing viewstate john ASP .Net 4 01-30-2004 03:25 PM



Advertisments