1、下载Ajaxpro.2.dll

    程序中引用

  2、web.config配置

<?xml version="1.0" encoding="utf-8"?>

<!--
有关如何配置 ASP.NET 应用程序的详细消息,请访问
http://go.microsoft.com/fwlink/?LinkId=169433
--> <configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" /> <httpHandlers>
<!--<add verb="*" path="*/show-?*-?*.html" type="UrlRewriter" />-->
<add verb="*" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2" validate="false"/>
</httpHandlers>
</system.web>
<system.webServer>
<defaultDocument>
<files>
<add value="Index.aspx" />
</files>
</defaultDocument>
<handlers>
<add name="AjaxPro.AjaxHandlerFactory" path="ajaxpro/*.ashx" verb="*" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2" preCondition="integratedMode"/>
</handlers>
<validation validateIntegratedModeConfiguration="false"/>
</system.webServer>
</configuration>

  

 3、页面中代码

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net;
using System.IO;
using System.Text; namespace HLBE.Admin
{
public partial class Gather : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(HLBE.Admin.Gather));
} [AjaxPro.AjaxMethod]
public string GetStr(string str)
{
return "213123";
}
}
}

  

  4、页面前段代码

  

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Gather.aspx.cs" Inherits="HLBE.Admin.Gather" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script language="javascript" type="text/javascript" src="../Js/JQuery.js"></script>
<script language="javascript" type="text/javascript">
function getServerTime() {
alert(HLBE.Admin.Gather.GetStr("1212").value);
} </script>
</head>
<body>
<form id="form1" runat="server">
</form>
<input id="Button1" type="button" value="button" onclick ="getServerTime();"/>
</body>
</html>

  5、注意地方

    页面中必须存在<form runat="server">表单,否则无法注册

  

Ajaxpro使用的方法的更多相关文章

  1. JavaScript调用后台的三种方法实例(包含两种Ajax)

    方法一:直接使用<%=%>调用(ASPX页面) 前台JS,代码如下: <script type="text/javascript"> var methodS ...

  2. AjaxPro对象参数传递

    1.客户端配置 2.服务端注册,配置 对象参数用到的方法 3.Web.config文件配置 需要注意的是ajax以及ajaxpro调用的方法必须是静态方法,如果存在非静态方法可以从页面作为参数传递

  3. Ajax.dll使用方法和步骤(比较方便的实现ajax)

    转载自   博客频道 - CSDN.NET http://blog.csdn.net/houhanxin1/article/details/6671470 1. 有直接用框架的:Ajaxpro和Aja ...

  4. javaSE27天复习总结

    JAVA学习总结    2 第一天    2 1:计算机概述(了解)    2 (1)计算机    2 (2)计算机硬件    2 (3)计算机软件    2 (4)软件开发(理解)    2 (5) ...

  5. c# js调用AjaxPro方法出错解析

    公司的项目的框架中有一部分用到了AjaxPro这个方法,看到这个方法的我一脸懵逼,老老实实去百度了一下. AjaxPro是.NET平台下的一个回调式AJAX框架,使用简单,功能强大.顾名思义ajax, ...

  6. AjaxPro使用方法

    无意中看到同事用AjaxPro用,看到很不错,特长是前后台传输数据特别方便. 最好的教材就是拿到就可以用,方便大家. 以前数据传输用FORM提交,或者在前台用JASON拼接然后通过AJAX方式提交.总 ...

  7. AjaxPro.dll,asp.net 前台js调用后台方法(无刷新)

    1.什么是Ajax Ajax是异步Javascript和XML(Asynchronous JavaScript and XML)的英文缩写."Ajax"这个名词的发明人是Jesse ...

  8. ajaxpro——js调用后台的方法

    前提:添加并引用类库ajaxpro.dll 1.把引用的类库改为自己(如果是自己的话,就不用修改): <%@ Page Language="C#" AutoEventWire ...

  9. 通过([AjaxPro.AjaxMethod(AjaxPro.HttpSessionStateRequirement.Read)] )在前台html页面调用cs方法

    app_code中CS代码( Cs页面文件名public class ajaxGET): [AjaxPro.AjaxMethod(AjaxPro.HttpSessionStateRequirement ...

随机推荐

  1. Factorial(hdu 1124)

    Description The most important part of a GSM network is so called Base Transceiver Station (BTS). Th ...

  2. 坦克大战学习笔记-TankWar

    最近学习了马士兵老师直播的单机版坦克大战,模仿的做了一个,整理一下思路记录下来,项目git地址:https://github.com/zhuchangli/TankWar/tree/master 视频 ...

  3. 转:LRU算法

    LRU是Least Recently Used的缩写,即最近最少使用页面置换算法,是为虚拟页式存储管理服务的,是根据页面调入内存后的使用情况进行决策了.由于无法预测各页面将来的使用情况,只能利用“最近 ...

  4. mybatis(二)

    一级缓存和二级缓存 mybatis一二级缓存测试实例: package com.atguigu.mybatis.test; import java.io.IOException; import jav ...

  5. Oracle查询和过滤重复数据

    对数据库某些意外情况,引起的重复数据,如何处理呢? ----------------查重复: select * from satisfaction_survey s and s.project_no ...

  6. Type curtilage home

    This year's National Day coincides with the Mid-Autumn festival, the double false merger about eight ...

  7. python字符串常用操作

    #### 1) 判断类型 - 9 | 方法 | 说明 || --- | --- || string.isspace() | 如果 string 中只包含空格,则返回 True | | string.i ...

  8. 自己练习的一个小的demo的时候a标签关于href链接的问题

    一.Js的几种调用方法(参考总结的) 1.a href="javascript:js_method();" 这是常用的方法,但是这种方法在传递this等参数的时候很容易出问题,而且 ...

  9. Fasttext原理

    fastText 模型输入一个词的序列(一段文本或者一句话),输出这个词序列属于不同类别的概率.序列中的词和词组组成特征向量,特征向量通过线性变换映射到中间层,中间层再映射到标签.fastText 在 ...

  10. vue2.0 添加监听滚动事件

    export default { data () { return { isFixed: true } }, mounted () { window.addEventListener('scroll' ...