开发者

how to avoid page postback on dropdown selected index changed

开发者 https://www.devze.com 2023-03-26 15:51 出处:网络
i have bind some dynamic data on selected index changed of dropdown,but when i click on submit button on page postback,data which was bound is gone.

i have bind some dynamic data on selected index changed of dropdown,but when i click on submit button on page postback,data which was bound is gone. As data is bind on selected index changed of dropdown,if(!(IsPostback)) is not working for me?

Can you pleas开发者_StackOverflow社区e tell how to solve this problem?Plz help

Thanks. Tina


The only way you can bind your dropdown control once only (i.e. only when IsPostBack is false) is to rely on the view state to maintain the list of items.

It sounds like the view state is not enabled on your drop down control (property EnableViewState). If that is not the problem, please consider posting your code here as the other commenters have requested, so the question can be useful to others.

0

精彩评论

暂无评论...
验证码 换一张
取 消