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 成员
    }

  • 相关阅读:
    python 获取当前路径
    python 执行结果输出为txt
    python def 定义函数
    python:浅析python 中__name__ = ‘__main__’ 的作用
    python 数组新增或删除元素
    python在Windows安装PIL的方法
    静态路由学习总结
    zookeeper客户端命令行操作
    kudu安装过程中可能出现的问题
    sudo: /etc/sudoers is world writable|给用户添加权限报错
  • 原文地址:https://www.cnblogs.com/ding0910/p/430428.html
Copyright © 2011-2022 走看看