DropDownList不会在SelectedIndexChanged上回发

编程入门 行业动态 更新时间:2024-10-25 14:23:43
本文介绍了DropDownList不会在SelectedIndexChanged上回发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我正在编写一个ASP.Net webform,其中有一些DropDownList控件。然后,用户在下拉列表中更改所选项目,ASP.Net似乎不处理SelectedIndexChanged事件,直到表单通过提交按钮单击提交。 如何让我的下拉列表立即处理SelectedIndexChanged?

P.S。这是一个经典的问题,我已经回答了太多次,但似乎没有人在stackoverflow之前问过。

解决方案

设置自动回覆属性为true将导致其在选择更改时进行回发。请注意,这需要启用javascript。

I'm writing an ASP.Net webform with some DropDownList controls on it. Then user changes selected item in one of dropdowns, ASP.Net doesn't seem to handle SelectedIndexChanged event until form is submitted with a 'Submit' button click. How do I make my dropdowns handle SelectedIndexChanged instantly?

P.S. It's a classic question I have answered too many times, but it seems no one asked it before on stackoverflow.

解决方案

Setting the AutoPostback property to true will cause it to postback when the selection is changed. Please note that this requires javascript to be enabled.

更多推荐

DropDownList不会在SelectedIndexChanged上回发

本文发布于:2023-10-12 21:06:55,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1485896.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:会在   上回   DropDownList   SelectedIndexChanged

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!