asp.net DropDownList 事件未触发
我的下拉列表有问题,当所选索引发生更改时,下拉列表似乎没有“注意到”。在表单上,它看起来像这样:
<asp:DropDownList ID="DDLResponsible" runat="server"></asp:DropDownList>
在表单上有另一个下拉列表,当该下拉列表中选定的索引发生更改时,将使用 javascript 重新加载该下拉列表。这很好用。但是,当我从此列表中选择一个项目并按表单上的“保存”按钮时,所选值似乎没有改变。
我尝试使用 AutoPostback = true 但这只是使两个列表重新加载为其原始值。
如果有人明白发生了什么事,请向我解释一下。
I have a problem with a dropdownlist that doesn't seem to "notice" when the selected index has changed. On the form it looks something like this:
<asp:DropDownList ID="DDLResponsible" runat="server"></asp:DropDownList>
On the form there is another dropdownlist and when the selected index changes in that one, this one is reloaded using javascript. This works fine. But when i select an item from this list and press the save button on the form, the selected value just doesn't seem to change.
I tried using AutoPostback = true but that just made both lists reload to their original values.
If anyone understands what's going on, please please please explain in to me.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你在Page.OnLoad上使用Page.IsPostBack吗?
如果你错过了它会导致这种行为..
你可以发布更多代码吗?
Do you use Page.IsPostBack on Page.OnLoad?
If you miss that it would cause this behavior..
Can you post more code?
似乎如果 Pageload 事件中缺少 IsPostBack 检查...请检查它,如果没有,请详细解释您的问题。
It seems that if IsPostBack check is missing in Pageload event.... please check it or if not then please explain you question more.