当前位置:编程学习 > C#/ASP.NET >>

ScriptManager的问题,在线等

代码
aspx

function SystemBtn_OnClick(id) 
    {
        alert(id);
        
        IndexMenu.GetMenu(id, CallBack, CallPP)

  }

  function CallBack(r) {
      alert(r);
  }

  function CallPP(r){
  alert(r._message);
  alert('数据填写有误,请核实!');

  }


<form id="form1" runat="server">
<asp:ScriptManager runat="server" ID="SM">
<Scripts>
    <asp:ScriptReference Path="IndexMenu.asmx" />
</Scripts>
</asp:ScriptManager>
。。。

新建了一个IndexMenu.asmx文件,并将代码只想AppCode文件夹下的IndexMenu类文件
<%@ WebService Language="C#" CodeBehind="../App_Code/IndexMenu.cs" Class="IndexMenu" %>

IndexMenu.cs文件代码如下

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[System.ComponentModel.ToolboxItem(false)]
[System.Web.Script.Services.ScriptService]

public class IndexMenu : System.Web.Services.WebService
{
    public IndexMenu()
    {
    }

    [WebMethod]
    public string GetMenu(string sSystemID)
    {
        return "Hello World";
    }
}

webConfig文件中也配置了
 <httpHandlers>
      <remove verb="*" path="*.asmx"/>
      <add verb="*" path="*.asmx" validate="false" type="Microsoft.Web.Script.Services.ScriptHandlerFactory, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
    </httpHandlers>

现在的问题是,页面调用的时候报“IndexMenu”未定义,求各位大侠帮忙看看,在线等 --------------------编程问答-------------------- 是不是要加static --------------------编程问答-------------------- 求帮忙呀。。。。。。
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,