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

  • 相关阅读:
    软件测试面试技巧-面试问题大全
    软件测试--实际项目的实际操作过程--免费资料
    知乎问:小白转行学软件测试;能就业吗?
    软件测试面试-如何高质量提交缺陷bug?
    如何自学软件测试--最真实的回答
    软件测试面试必问--bug交互流程
    苹果手机安装未上线App操作流程-实际公司-Dotest董浩
    Python自动化之下拉框,隐藏标签定位 代码&报错解决
    ​Linux环境下搭建禅道管理工具-包含软件资源
    Python自动化报错:IndentationError-unindent does not match any outer indentation level
  • 原文地址:https://www.cnblogs.com/ding0910/p/430428.html
Copyright © 2011-2022 走看看