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

发布于 2024-07-14 10:02:01 字数 66 浏览 3 评论 0原文

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

What is the EventName property when I set up a ASP.NET checkbox control as an async postback trigger for an asp.net update panel?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

给我一枪 2024-07-21 10:02:02

我相信它是CheckedChanged。

I believe it is CheckedChanged.

灵芸 2024-07-21 10:02:02

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

<asp:CheckBox runat="server" ID="chk_Name" AutoPostBack="true" OnCheckedChanged="chk_Name_OnCheckedChanged"></asp:CheckBox>

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

protected void chk_Name_OnCheckedChanged(object sender, EventArgs e) 
{
     // Do stuff here
}

All you have to do is set AutoPostback to true and if your CheckBox is within the UpdatePanel you shouldnt have any problems

<asp:CheckBox runat="server" ID="chk_Name" AutoPostBack="true" OnCheckedChanged="chk_Name_OnCheckedChanged"></asp:CheckBox>

Then in the OnCheckedChanged function you can do whatever you need to do

protected void chk_Name_OnCheckedChanged(object sender, EventArgs e) 
{
     // Do stuff here
}
離殇 2024-07-21 10:02:02

OnCheckedChanged 是事件名称。 您可以通过双击 UI 中的复选框来自动生成该方法,并根据复选框名称生成最有可能是的方法:

protected void CheckBox1_OnCheckedChanged(object sender, EventArgs e) {}

OnCheckedChanged is the event name. You can autogenerate the method by double clicking the checkbox in the UI, and based on the checkbox name it will generate the method which will most likely be:

protected void CheckBox1_OnCheckedChanged(object sender, EventArgs e) {}
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文