zoukankan      html  css  js  c++  java
  • asp.net 2.0 中无刷新机制

    <%@ Page Language="C#" %>
    <%@ Implements Interface="System.Web.UI.ICallbackEventHandler" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

    <script runat="server">
        
    protected void Page_Load(object sender, EventArgs e)
        
    {
            
    string callback = this.ClientScript.GetCallbackEventReference(this"this.value""ProcessReverse"null);
            
    this.TextBox1.Attributes.Add("onchange", callback);
        }


        
    string ICallbackEventHandler.RaiseCallbackEvent(string eventArgument)
        
    {
            
    char [] chars = eventArgument.ToCharArray();
            Array.Reverse(chars);
            
    return new string(chars);
        }

    </script>

    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head id="Head1" runat="server">
        
    <title>Untitled Page</title>
    </head>
    <body>
        
    <form id="form1" runat="server">
        
    <div>
        
    <asp:TextBox ID="TextBox1" Runat="server"></asp:TextBox>
        
    </div>
            
        
    </form>
    </body>
    </html>
    <script>
    function ProcessReverse(result,context)
    {
        alert(result)
        document.all.TextBox1.value 
    = result;
    }

    </script>
  • 相关阅读:
    AC自动机【学习笔记】
    SCOI2016 背单词【Trie树,贪心】
    【字符串算法】字典树Trie入门
    USACO 1.3 Name That Number【暴搜】
    MapReduce分组
    MapReduce排序
    博客园添加访问人数统计
    MapReduce的分区
    MapReduce的计数器
    MapReduce部分源码解读(一)
  • 原文地址:https://www.cnblogs.com/goodspeed/p/35796.html
Copyright © 2011-2022 走看看