zoukankan      html  css  js  c++  java
  • AjaxPro 框架学习 (支持vs2003/vs2005)

    AjaxPro 相关资类
    Web配制

    <?xml version="1.0" encoding="utf-8" ?>
    <configuration>
      <system.web>
        <httpHandlers>
          <add verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/>
        </httpHandlers>

      </system.web>
    </configuration>

    方法

     [AjaxPro.AjaxMethod]
    public DateTime GetServerTime()
    {
      return DateTime.Now;
    }

    页面CS

    namespace MyDemo
    {
      public class _Default
      {
        protected void Page_Load(object sender, EventArgs e)
        {
          AjaxPro.Utility.RegisterTypeForAjax(typeof(_Default));
        }

        [AjaxPro.AjaxMethod]
        public DateTime GetServerTime()
        {
          return DateTime.Now;
        }
      }
    }

    页面aspx

    function getServerTime()
    {
    MyDemo._Default.GetServerTime(getServerTime_callback);  // asynchronous call
    }
    // This method will be called after the method has been executed
    // and the result has been sent to the client.
    function getServerTime_callback(res)
    {
    alert(res.value);
    }
    简单吧!可以支持vs2003/vs2005
     
  • 相关阅读:
    ansible 批量在远程主机上执行命令
    SQLAlchemy
    operator, itertools
    mongodb基础语法
    django model Meta选项
    __getattr__,settr
    django的contenttype表
    time和datetime和tzinfo
    全局钩子的改名
    dom中文字居中
  • 原文地址:https://www.cnblogs.com/sgciviolence/p/1263277.html
Copyright © 2011-2022 走看看