读书人

ScriptManager、UpdatePanel,该如何解

发布时间: 2013-03-12 11:19:35 作者: rapoo

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
后台没有这个方法吧

读书人网 >asp.net

热点推荐