我在本地是好的,都可以用的,但是发布到iis上面就失效了,webservice根本就没有调用是不是路径的问题,
我在页面是这样写的
 function GetCompetence(uid, forum, colObject, opelim) {
    var haha = "";
    $.ajax({
        type: 'post',
        contentType: 'application/json',
        url: '../ToolService.asmx/GetCompetence',
        data: '{"uid":"' + uid + '","_forum":"' + forum + '","_colObject":"' + colObject + '","_opelim":"' + opelim + '"}',
        dataType: 'json',
        async: false,
        success: function(result) {
            haha = ($.trim(result.d));
        }
    })
    return haha;
}
下面是webservice的方法,在本地都能调用的,是不是伪静态之后,webservice也要重写的  [WebMethod]
        public string GetCompetence(string uid, string _forum, string _colObject, string _opelim)
        {
          
             string _competence = _forum + _colObject + _opelim;
            if (uid == null || uid.Length == 0)
                return "对不起,您没有登录";            var newUser = bllUser.SelectUserByColId(Convert.ToInt32(uid));
            if (newUser != null && newUser.Col_group.Length != 0)
            {
                if (newUser.Col_right == null || newUser.Col_right.Length == 0)
                    return "对不起,您没有相应的权限";
                else
                {
                    string _res = CheckA(newUser.Col_right.Trim(),_forum,_colObject,_opelim);;                    if (_res.Contains(_competence))
                    {
                        return "true";
                    }
                    else
                    {
                        return "对不起,您没有相应的权限";
                    }
                }
            }            return "对不起,您没有相应的权限";
        }请各位高手赐教

解决方案 »

  1.   

    url: '<%=Page.ResolveUrl("~")%>ToolService.asmx/GetCompetence',你需要判断看是否调用了ToolService.asmx
      

  2.   

    是调用的了,本地都是好的,但是发布到iis上面都不行的了,如果url: '<%=Page.ResolveUrl("~")%>ToolService.asmx/GetCompetence',这样写  在web.config里面需不需要配置的
      

  3.   

    首先你在浏览器里输入http:/xxx/ToolService.asmx/GetCompetence看访问吗
      

  4.   

    url: '../ToolService.asmx/GetCompetence',这上加个时间戳试试,是不是有缓存那。
      

  5.   

    那就修改你的url重写,重写出了问题
      

  6.   

    啊,不是吧,其他的都是好的呀,就是发布到iis上不行的,webservice也要进行重写才能识别的
      

  7.   

    url: 'http://xxxxxxxxxxxxx/ToolService.asmx/GetCompetence',那就写你浏览器里面能访问的url