Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

dropdown list populated via JavaScript, but values lost if postback

Status
Not open for further replies.

lmohr79

Technical User
Jan 18, 2005
39
US
I have a populated dropdown list. Via JavaScript, the user can enter a value into the list where it will be added, sorted and the selected index will be changed accordingly. However, if a postback occurs, the new values are lost. I know the server has no idea the values have been added, but why isn't __Viewstate taking care of this?
 
The ViewState does not know that the values have been added because you are adding the items clientside, not serverside. The ViewState will only hold serverside changes to the values.

Jim
 
So, to get around the problem you could post the values to the ASP.NET page and then add them on the client side.


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
I am working around this problem with a hidden field and an onload event. Which, I think, is what the last comment leading to. Thanks, I appreciate the fast turn around!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top