Click here to Skip to main content
15,901,122 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a dropdownlist which is populated by jQuery and dropdownlist has a autopostback event.
I want to call a dropdownlist selected index changed event by jQuery and load data in ASP.NET Gridview, but data is vanished when I select a item from dropdownlist.

Give me a suitable solution.
Posted
Updated 10-Oct-10 22:09pm
v2
Comments
Sandeep Mewara 11-Oct-10 4:15am    
Well, surely you are doing some mistake. It's doable. Post important code-snippets here.

Further, use Debugger to see what's the flow and when do you loose your data.

1 solution

You're adding items into the dropdown on the client, but when the postback happens, the server-side rebuilds the dropdown from the viewstate therefore the new items "vanish".

You need to either a) add the items into the dropdown on the server or b) record details of the new items when they're created on the client (in a hidden form variable probably) and when the postback occurs, use those details to add the new items on the server-side.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900