开发者

ASP DROP DOWN list, onchage event doesn,t work

开发者 https://www.devze.com 2023-01-05 20:14 出处:网络
If I use onchange=return fn1(), in client side even the fn1 return false it automatically fi开发者_如何学运维red the server side onselectedindexchange event. How can I stop the server side event if th

If I use onchange=return fn1(), in client side even the fn1 return false it automatically fi开发者_如何学运维red the server side onselectedindexchange event. How can I stop the server side event if the script fn1 return false?


you can't, I had a similar problem too, not long time ago... simply putted asp.net controls where is initialized to invoke postback it will, there is no way you can elegantly prevent that...

instead of trying to intercept invoked postback on your index_changed and blocked or not, you can put one hidden button and then from client decide when you will fire that postback through client call on that button(button.click())..

not so nice, but I didn't find a better solution for that scenario

cheers

p.s. oh, yes you need to remove autopostback="true" on that dropdown control

0

精彩评论

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