没有用于处理ASP.NET中的下拉列表的事件 [英] No events for handling the dropdownlist in ASP.NET
问题描述
我的Asp.net页面中有一个DropDownList控件。
I have a DropDownList control in my Asp.net page.
<asp:DropDownList ID="DDUserList" CausesValidation="true"
OnTextChanged="DropDownChange" runat="server" CssClass="DropDown" AppendDataBoundItems="True" />
列表是将它加载到控件中,但是当我试图选择一个项目时,没有任何事件可以缓存它。
这个问题有什么解决方案吗?
我尝试了什么:
最后我看到了一个事件加注。
那是
The List is Load it in the control but when I.m trying to Select one Item then there no any event to cache it.
Is any solution to this issue?
What I have tried:
Finally I saw an event raise.
And that is the
DDUserList.SelectedIndexChanged
但不是在我需要的时候。当我在控件中进行新选择并尝试离开该面板并转到其他位置时,它会引发;在同一页面。
然后事件加剧。
但这不是我想要的。
问题仍然存在。
But NOT when I need it. It raise when I made a new selection in the control and trying to leave that Panel and go somewhere else; in the same page.
Then the event raises.
But that is not what I want.
Problem remains.
推荐答案
我认为这个问题已经解决了。
但我不知道这是不是正确的。
我添加我的as.net区域中的AutoPostBack =True并且事件会加剧。
如果这是正确的解决方案,请回答。
谢谢
I think the issue is solved.
But I don't know if that is the right one.
I add the AutoPostBack="True" in my as.net area and the event raises.
If that is the right solution please answer.
Thank you
SelectedIndexChanged
事件只会在您设置AutoPostback后触发
到True
。它默认为false
。
TheSelectedIndexChanged
event will only fire once you setAutoPostback
toTrue
. It'sfalse
by default.
这篇关于没有用于处理ASP.NET中的下拉列表的事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!