博客
关于我
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/

你可能感兴趣的文章
Nginx 负载均衡详解
查看>>
nginx 配置 单页面应用的解决方案
查看>>
nginx 配置https(一)—— 自签名证书
查看>>
nginx 配置~~~本身就是一个静态资源的服务器
查看>>
Nginx 配置清单(一篇够用)
查看>>
Nginx 配置解析:从基础到高级应用指南
查看>>
nginx+php的搭建
查看>>
nginx+tomcat+memcached
查看>>
nginx+Tomcat性能监控
查看>>
nginx+uwsgi+django
查看>>
Nginx-http-flv-module流媒体服务器搭建+模拟推流+flv.js在前端html和Vue中播放HTTP-FLV视频流
查看>>
Nginx下配置codeigniter框架方法
查看>>
Nginx之二:nginx.conf简单配置(参数详解)
查看>>
Nginx代理websocket配置(解决websocket异常断开连接tcp连接不断问题)
查看>>
Nginx代理初探
查看>>
Nginx代理外网映射
查看>>
Nginx代理模式下 log-format 获取客户端真实IP
查看>>
Nginx代理静态资源(gis瓦片图片)实现非固定ip的url适配网络环境映射ip下的资源请求解决方案
查看>>
Nginx反向代理与正向代理配置
查看>>
Nginx多域名,多证书,多服务配置,实用版
查看>>