zoukankan      html  css  js  c++  java
  • ICallbackEventHandler接口实现无刷新调用后台

    前台HTML代码
    using System;
    using System.Data;
    using System.Configuration;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;

    public partial class _Default : System.Web.UI.Page, System.Web.UI.ICallbackEventHandler //实现ICallbackEventHandler接口
    {
        
    private string _callbackEventArgument; 

        
    protected void Page_Load(object sender, EventArgs e)
        
    {
            String cbReference 
    = Page.ClientScript.GetCallbackEventReference(this"arg""ReceiveServerData""context");
            String callbackScript;
            callbackScript 
    = "function CallTheServer(arg,context)" + "" + cbReference + "} ;";
            Page.ClientScript.RegisterStartupScript(
    this.GetType(), Guid.NewGuid().ToString(), callbackScript, true);     
        }

        
    public String RaiseCallbackEvent(String eventArgument)
        
    {
            
    return "你选择的是:" + eventArgument;
        }

        
        
    //自动生成接口成员
        ICallbackEventHandler 成员
    }

  • 相关阅读:
    第32周二
    第32周一
    第31周日
    第31周六
    第31周五
    第31周四
    第31周三
    C++中this指针的使用方法.
    ArcPad 10 的安装部署
    UEditor用法
  • 原文地址:https://www.cnblogs.com/ding0910/p/430428.html
Copyright © 2011-2022 走看看