日期:2014-05-17  浏览次数:20409 次

ScriptManager、UpdatePanel

<asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
       <ContentTemplate>
        <asp:DropDownList ID="DropDownList1" runat="server" 
            onselectedindexchanged="DropDownList1_SelectedIndexChanged">
            <asp:ListItem>1</asp:ListItem>
        </asp:DropDownList>
       </ContentTemplate>
            <Triggers>
                <asp:AsyncPostBackTrigger ControlID="DropDownList1" EventName="DropDownList1_SelectedIndexChanged" /> 
            </Triggers>
   </asp:UpdatePanel>

局部刷新,不知道哪里出错

对于 UpdatePanel“UpdatePanel1”中的触发器,未能在关联的控件“DropDownList1”上找到名为“DropDownList1_SelectedIndexChanged”的事件。

------解决方案--------------------
后台没定义DropDownList1_SelectedIndexChanged事件

看.cs文件里有这个吗?
public void DropDownList1_SelectedIndexChanged(object sender, EventsArg e)
{
   ...
}
------解决方案--------------------
DropDownList1_SelectedIndexChanged
后台没有这个方法吧