本文介绍了html 选择(下拉)控件在asp.net中选择索引更改事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当值更改为要触发的后端方法时,我试图将后端代码放入我的 html 选择控件(下拉列表),但我找不到该事件.我试过这种方式:
I am trying to put backend code to my html select control (dropdown) when the value is changed a backend method to be triggered, but I Can't find the event.I tried this way:
<select id="ddlCompany" name="select2" onchange="ddlCompany_SelectedIndexChanged" runat="server" class="dropdown nostyle sel1" style="width:100%;" placeholder="Select Company" />
没有任何变化.谁能建议我如何解决这个问题?谢谢,拉齐亚勒
nothing changes.Can anyone advice how I can fix this?Thx, Laziale
推荐答案
尝试使用 SelectedIndexChanged 属性而不是 onchange,如下所示:
Try using the SelectedIndexChanged property instead of onchange, like this:
<select id="ddlCompany" name="select2" OnSelectedIndexChanged="ddlCompany_SelectedIndexChanged" runat="server" class="dropdown nostyle sel1" style="width:100%;" placeholder="Select Company" />
这篇关于html 选择(下拉)控件在asp.net中选择索引更改事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!