asp:带有ASP.NET复选框触发器的UpdatePanel

Mic*_*ern 5 asp.net ajax checkbox updatepanel asynchronous

当我将ASP.NET复选框控件设置为asp.net更新面板的异步回发触发器时,EventName属性是什么?

Jak*_*sen 10

我相信它是CheckedChanged.


Jos*_*ein 6

您所要做的就是将AutoPostback设置为true,如果您的CheckBox位于UpdatePanel内,则不应该有任何问题

<asp:CheckBox runat="server" ID="chk_Name" AutoPostBack="true" OnCheckedChanged="chk_Name_OnCheckedChanged"></asp:CheckBox>
Run Code Online (Sandbox Code Playgroud)

然后在OnCheckedChanged函数中,您可以执行任何操作

protected void chk_Name_OnCheckedChanged(object sender, EventArgs e) 
{
     // Do stuff here
}
Run Code Online (Sandbox Code Playgroud)