博客
关于我
asp.net代码练习 work015 回调技术
阅读量:310 次
发布时间:2019-03-03

本文共 2191 字,大约阅读时间需要 7 分钟。

webform1.aspx

        <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="work015.WebForm1" %>        
回调技术
用户名
密码

webform1.aspx.cs

        using System;        using System.Collections.Generic;        using System.Linq;        using System.Web;        using System.Web.UI;        using System.Web.UI.WebControls;        namespace work015 {            public partial class WebForm1 : System.Web.UI.Page, ICallbackEventHandler {                string result = "";                protected void Page_Load(object sender, EventArgs e) {                    ClientScriptManager csm = Page.ClientScript;                    string reference = csm.GetCallbackEventReference(this, "args", "Success", "", "Error", false);                    string callbackScript = "function CallServerMethod(args,context) {\n" + reference + "\n}";                    csm.RegisterClientScriptBlock(this.GetType(), "CallServerMethod", callbackScript, true);                }                public void RaiseCallbackEvent(string eventArgs) {                    if (eventArgs.ToLower().IndexOf("admin") != -1) {                        result = string.Format("{0}已被注册", eventArgs);                    } else {                        result = eventArgs + "可以注册";                    }                }                public string GetCallbackResult() {                    return result;                }            }        }    

转载地址:http://yirm.baihongyu.com/

你可能感兴趣的文章
python 利用已有Ner模型进行数据清洗合并
查看>>
python 到大数据开发工程师_如何成为一个大数据开发工程师?
查看>>
python 加密解密(base64, AES)
查看>>
Python 包管理器和 Node.js
查看>>
Python 单词字母顺序不变且所有倒排
查看>>
python 反射机制
查看>>
python 启动提示IDLE's subprocess didn't make conne...
查看>>
python 命令接口_实现“[命令][操作][参数]”样式的命令行接口?
查看>>
Python 和 OpenCV.如何检测图像中的所有(填充)圆形/圆形对象?
查看>>
Python 和 RabbitMQ - 聆听来自多个渠道的消费事件的最佳方式?
查看>>
python编辑器打不开_关于命令ride.py打不开RF,而是打开pycharm编辑器问题解决思路...
查看>>
python编译exe同时支持32位_第三周:同时管理64位和32位版本的Python,并用Pyinstaller打包成exe...
查看>>
Python 和Java 哪个更适合做自动化测试?
查看>>
Python编程:掌握高级语言程序设计。从零基础到精通,收藏这篇就够了!
查看>>
python 图片转ico
查看>>
python 图片转文字、语音转文字、文字转语音保存音频并朗读
查看>>
python 在包含类似字符\x16、\x12、\x某某的数组中将以\x开头的字符找出来的方法
查看>>
Python 在并行进程之间共享字典
查看>>
Python 垃圾收集器文档
查看>>
python 基于 wordcloud + jieba + matplotlib 生成词云
查看>>