我的DropDownList处理程序没有执行。 [英] My DropDownList handler isn't executing.

查看:57
本文介绍了我的DropDownList处理程序没有执行。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个asp:dropdownlist设置为autopostback。


然而,我的处理程序似乎没有执行(即使有一个


这里是DDL:


< asp:dropdownlist id = ddl_districtSelect runat =" server" AutoPostBack =" True"

(列表项)

< / asp:dropdownlist>


和处理程序:


Private Sub ddl_districtSelect_SelectedIndexChanged(ByVal sender As

System.Object,ByVal e As System.EventArgs)Handles

ddl_districtSelect。 SelectedIndexChanged

response.Write(" MONKEY")

End Sub


任何原因导致无法执行?


-Darrel

I have a asp:dropdownlist set to autopostback.

However, my handler doesn''t seem to execute (even though there is a
postback).

Here''s the DDL:

<asp:dropdownlist id=ddl_districtSelect runat="server" AutoPostBack="True">
(list items)
</asp:dropdownlist>

and the handler:

Private Sub ddl_districtSelect_SelectedIndexChanged(ByVal sender As
System.Object, ByVal e As System.EventArgs) Handles
ddl_districtSelect.SelectedIndexChanged
response.Write("MONKEY")
End Sub

Any reason why this wouldn''t be executing?

-Darrel

推荐答案

>但是,我的处理程序似乎没有执行(即使有一个
> However, my handler doesn''t seem to execute (even though there is a
回发)。




嗯...我也是有另一个问题。自动回发不保留

选择的值。它一直在恢复到第一项。


我通常不会使用下拉自动回发,所以我完全没有

''获得这里有一些基本概念吗?


-Darrel



Hmm...I also have another problem. The auto-postback isn''t retaining the
selected value. It keeps reverting to the first item.

I don''t normally use drop down auto-postbacks, so am I just completely not
''getting'' some fundamental concept here?

-Darrel


每次页面加载时你重新绑定数据吗?这可能是你的b $ b问题。你只需要绑定一次。


darrel <无***** @ hotmail.com>在消息中写道

news:%2 **************** @ TK2MSFTNGP09.phx.gbl ...
Are you rebinding the data every time the page loads? This may be your
problem. You only need to bind once.

"darrel" <no*****@hotmail.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
然而,我的处理程序似乎没有执行(即使有回发)。
However, my handler doesn''t seem to execute (even though there is a
postback).



嗯...我还有另一个问题。自动回发不保留
选定的值。它一直在恢复到第一项。

我通常不会使用下拉式自动回发,所以我完全没有获得一些基本概念吗? br />
-Darrel



Hmm...I also have another problem. The auto-postback isn''t retaining the
selected value. It keeps reverting to the first item.

I don''t normally use drop down auto-postbacks, so am I just completely not
''getting'' some fundamental concept here?

-Darrel



每次页面加载时是否重新绑定数据?这可能是你的问题。你只需要绑定一次。
Are you rebinding the data every time the page loads? This may be your
problem. You only need to bind once.




不。根本没有数据绑定。只是一个简单的选项列表就在HTML

本身。


-Darrel



Nope. no databinding at all. Just a simple option list right in the HTML
itself.

-Darrel


这篇关于我的DropDownList处理程序没有执行。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆