本文介绍了DropDownList的不回传上的SelectedIndexChanged的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在写一个ASP.Net Web窗体与它的一些DropDownList控件。然后选定用户的变化项的下拉列表中的一个,ASP.Net似乎并不直到形式与提交按钮,点击提交处理SelectedIndexChanged事件。
如何让我的下拉菜单立即处理的SelectedIndexChanged?

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。这是一个典型的问题我已经回答过很多次,但似乎没有人问过它计算器。

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

推荐答案

设置AutoPostback属性为true,将会导致当选择改变它回发。请注意,这需要启用JavaScript。

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的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-29 00:59