日期:2014-05-18  浏览次数:20454 次

询问一个ajaxpro 在iis6上发布问题

我在本地调试没有问题
但是 传到 供应商的iis6 服务器上 ,在客户端 浏览 就会报js错误

部分代码如下

cs文件
public partial class _Defaultajax : System.Web.UI.Page 
{
  protected void Page_Load(object sender, EventArgs e)
  {
  AjaxPro.Utility.RegisterTypeForAjax(typeof(_Defaultajax)); //注册ajaxPro,括号中的参数是当前的类名
  }

  [AjaxPro.AjaxMethod ] //申明是ajaxPro方法
  public string GetServerTime()
  {
  return DateTime.Now.ToString();
  }
}
aspx文件
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Defaultajax" %>

<!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" >
   
  function getServerTime()
  {
  // 调用服务端方法
  //调用方法:类名.方法名 (参数为指定一个回调函数)
  _Defaultajax.GetServerTime(getServerTime_callback);  
  }
  function getServerTime_callback(res) //回调函数,显示结果
  {
  alert(res.value);
  }
  </script>
</head>
<body>
  <form id="form1" runat="server">
  <div>
  <input id="Button1" type="button" value="button" onclick ="getServerTime();"/></div>
  </form>
</body>
</html>

webconfig里面

  <system.web>
  <httpHandlers>
  <add verb="POST,GET" path="ajaxpro/*.ashx" type="AjaxPro.AjaxHandlerFactory, AjaxPro.2"/>
  </httpHandlers>
  <httpModules>

------解决方案--------------------
Up!!!
------解决方案--------------------
帮顶下咯,up
------解决方案--------------------
要在asp.net中利用AjaxPro开发,需要进行如下操作:
(1)将AjaxPro.2.dll拷贝到网站的bin文件下(如果没有请创建一个,这是asp.net内置的文件夹,用于存放第三方的动态链接库文件)。
(2)在web.config的configuration根结点中增加一个configSections节点,如下:
XML code
<configSections>
        <sectionGroup name="ajaxNet">
            <!--
                If you are using Microsoft .NET 1.1 please remove the two attributes
                requirePermission and restartOnExternalChanges, they are only supported
                with .NET 2.0.
            -->
            <section name="ajaxSettings" type="AjaxPro.AjaxSettingsSectionHandler,AjaxPro.2" requirePermission="false" restartOnExternalChanges="true"/>
        </sectionGroup>
    </configSections>

------解决方案--------------------
什么网址,我帮你测下在研究下什么原因
------解决方案--------------------
mark一下