繁体   English   中英

为什么DropDownList事件在另一个事件之后触发

[英]Why DropDownList event fires after another event

我的页面中有一个DropDownList

<asp:DropDownList ID="ddlPra" ClientIDMode="Static" CssClass="chosen-select" runat="server" OnSelectedIndexChanged="Practice_SelectedIndexChanged"></asp:DropDownList>

背后的代码:

protected void Practice_SelectedIndexChanged(object sender, EventArgs e)
{
    MessageBox.Show(ddlCli.SelectedItem.Text);
}

我也有一个UpdatePanel ,它具有一个GridView that displays some data with links. The issue I am having is when the page loads and I change the option from the select drop down, I don't get an alert but when I click on anything inside the GridView that displays some data with links. The issue I am having is when the page loads and I change the option from the select drop down, I don't get an alert but when I click on anything inside the UpdatePanel中的GridView that displays some data with links. The issue I am having is when the page loads and I change the option from the select drop down, I don't get an alert but when I click on anything inside the会显示警报。

我如何解决它,以便DropDownList独立于UpdatePanel

为什么DropDownList事件在另一个事件之后触发?

由于尚未设置AutoPostBack="true" ,因此默认情况下为false 这意味着它不会在用户选择其他项目后立即回发。 但是无论如何,该事件都会在下一次回发中触发,而与导致该事件的控件无关。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM