-----------------------------------------------------------------------页面代码
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="testajax.aspx.cs" Inherits="WebApplication1.testajax" %><!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 type="text/javascript" src="Scripts/page.js"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="Button1" type="button" value="button" onclick="op()"/>
</div>
</form>
</body>
</html>-----------------------------------------------------------------------后台代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services.Protocols;
using AjaxPro;namespace WebApplication1
{
public partial class testajax : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{}
[AjaxMethod]
public void osl()
{
Response.Write("ok");
}
}
}-----------------------------------------------------------------------JS代码
function op() { WebApplication1.testajax.osl();
}
-----------------------------------------------------------------------config
<httpHandlers>
<add verb="POST,GET" path="ajax/*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/>
</httpHandlers>但是怎么也运行不成功 总提示WebApplication1未定义
我不熟悉VS2010 我觉得以前用VS2005的时候就以上这样写就行了
2010 下是不是还得配其他什么东西呢? 或者2010有什么另外的写法
求解
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="testajax.aspx.cs" Inherits="WebApplication1.testajax" %><!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 type="text/javascript" src="Scripts/page.js"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="Button1" type="button" value="button" onclick="op()"/>
</div>
</form>
</body>
</html>-----------------------------------------------------------------------后台代码
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.Services.Protocols;
using AjaxPro;namespace WebApplication1
{
public partial class testajax : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{}
[AjaxMethod]
public void osl()
{
Response.Write("ok");
}
}
}-----------------------------------------------------------------------JS代码
function op() { WebApplication1.testajax.osl();
}
-----------------------------------------------------------------------config
<httpHandlers>
<add verb="POST,GET" path="ajax/*.ashx" type="AjaxPro.AjaxHandlerFactory,AjaxPro.2"/>
</httpHandlers>但是怎么也运行不成功 总提示WebApplication1未定义
我不熟悉VS2010 我觉得以前用VS2005的时候就以上这样写就行了
2010 下是不是还得配其他什么东西呢? 或者2010有什么另外的写法
求解
解决方案 »
- 关于委托一问求一正解,进者有份
- 在asp.net下利用DataList绑定控件,无法实现分页,请求帮忙!
- 在vs里怎么做透明的导航?鼠标放上去会变色,并跟随出透明下拉式菜单,发现松下的导航栏做的很漂亮,不知道怎么实现的
- 怎么动态取得当前浏览页的网址呢?
- 远程主机强迫关闭了一个现有的连接
- 奇怪的MSSQL升级到SP4问题.在线等
- 大家在insert大量的string数据时是怎么做的?
- 2个flash交户的问题 在静态页面钟可以实现 就是在aspx文件中有了form标记就会出现未将对象设置到对象实例
- 关于校验控件中的ClientValidationFunction事件的参数的问题
- 一个关于session和登陆的问题
- NopCommerce下载后无法访问Install.aspx页面,求帮助!
- 通过AjaxPro.2异步获取处理信息的方法,请指教
AjaxPro.Utility.RegisterTypeForAjax(typeof());