UpdatePanel触发器,如何为__doPostBack设置触发器事件? [英] UpdatePanel Triggers, how to set trigger event for __doPostBack?

查看:91
本文介绍了UpdatePanel触发器,如何为__doPostBack设置触发器事件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的页面上有一个UpdatePanel,我想为其设置一些触发器:

I have an UpdatePanel on my page which I would like to set up some triggers for:

<asp:updatepanel id="updatepanel1" runat="server">
     <contenttemplate>
          <asp:label id="lblfoo" runat="server />
     </contenttemplate>
     <triggers>
          <asp:asyncpostbacktrigger controlid="CormantRadTabStrip1" eventname="???" />
     </triggers>
</asp:updatepanel>

并且我有一些相关的javascript:

and I have some related javascript:

function CloseAndSave() {
    window.__doPostBack(CormantRadTabStrip1);
}

在服务器端,我已经让酒吧实现了IPostBackEventHandler接口.

On the server-side I have made bar implement the IPostBackEventHandler interface.

这种事情似乎没有明确的事件名称吗?我应该将事件名称发送为什么?

There doesn't seem to be an explicit event name for this sort of thing, though? What should I sent the eventname to be?

谢谢

public class CormantRadTabStrip : RadTabStrip, IPostBackEventHandler
{
    /// <summary>
    /// This is called when the GlobalSettings dialog window closes.
    /// </summary>
    /// <param name="eventArgument">JSON passed to the event representing state of tabs</param>
    void IPostBackEventHandler.RaisePostBackEvent(string eventArgument)
    {
        UpdateTabs();
    }
}

推荐答案

事件名称应该是您的 bar (或 CormantRadTabStrip1 >)控件会导致回发.请参阅 msdn 文档以了解一些常见信息(默认)事件名称值.

The eventname should be whatever type of event your bar (or CormantRadTabStrip1) control causes the postback. See the msdn doc for some common (default) eventname values.

这篇关于UpdatePanel触发器,如何为__doPostBack设置触发器事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆