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

你可能感兴趣的文章
Objective-C实现Queue队列算法(附完整源码)
查看>>
Objective-C实现Queue队列算法(附完整源码)
查看>>
Objective-C实现quick select快速选择算法(附完整源码)
查看>>
Objective-C实现rabin-karp算法(附完整源码)
查看>>
Objective-C实现radians弧度制算法(附完整源码)
查看>>
Objective-C实现radianToDegree弧度到度算法(附完整源码)
查看>>
Objective-C实现radix sort基数排序算法(附完整源码)
查看>>
Objective-C实现rail fence围栏密码算法(附完整源码)
查看>>
Objective-C实现randomized heap随机堆算法(附完整源码)
查看>>
Objective-C实现rayleigh quotient瑞利商算法(附完整源码)
查看>>
Objective-C实现RC4加解密算法(附完整源码)
查看>>
Objective-C实现RC4加解密算法(附完整源码)
查看>>
Objective-C实现recursive bubble sor递归冒泡排序算法(附完整源码)
查看>>
Objective-C实现recursive insertion sort递归插入排序算法(附完整源码)
查看>>
Objective-C实现recursive quick sort递归快速排序算法(附完整源码)
查看>>
Objective-C实现RedBlackTree红黑树算法(附完整源码)
查看>>
Objective-C实现redis分布式锁(附完整源码)
查看>>
Objective-C实现regular-expression-matching正则表达式匹配算法(附完整源码)
查看>>
Objective-C实现relu线性整流函数算法(附完整源码)
查看>>
Objective-C实现restful api服务(附完整源码)
查看>>