MsgBox 未显示正确的值
我有一个 DropDownList
,当 SelectedIndex
更改时,会触发任何事件。
我正在以 msgbox 为例,但它不起作用。
有什么问题吗?
EDIT;
现在,在执行 AutoPostBack = True
后就可以工作了。 我这样做了,但结果并不总是“0”
Protected Sub VD_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
MsgBox VD.SelectedIndex
End Sub
I have a DropDownList
, and when SelectedIndex
is changed any event is triggered.
I'm putting on it for exemple msgbox, but it's not working.
What's the problem ?
EDIT;
now that's working after doing AutoPostBack = True
.
I did this, but i't giving me always '0' as result
Protected Sub VD_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs)
MsgBox VD.SelectedIndex
End Sub
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您需要将 AutoPostBack = True 并将事件挂接到 OnSelectedIndexChanged。
You need to have AutoPostBack = True and hook up an event to OnSelectedIndexChanged.
您是否将控件上的
AutoPostBack
值设置为true
?Have you set the
AutoPostBack
value on your control totrue
?