using System;
using System.Web;
using System.Collections;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Web.UI.MobileControls;
using SG_Soft_SqlDAL;
using System.Web.Script.Services;
/// <summary>
/// Hello 的摘要说明
/// </summary>
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[ScriptService]
public class Hello : System.Web.Services.WebService
{    public Hello()
    {        //如果使用设计的组件,请取消注释以下行 
        //InitializeComponent(); 
    }    [WebMethod]
    public string HelloWorld()
    {
        return "Hello World";
    }
    /// <summary>
    /// 查询类别的返回参数
    /// </summary>
    /// <returns>总记录数</returns>
    [WebMethod]
    public string GetCategoryCount()
    {
        CategoryMan cm = new CategoryMan();
        int count = cm.GetCategoryCount();
        return count.ToString();
    }}$.ajax({
            url:"Hello.asmx/GetCategoryCount",
            type:"POST",
            dataType:"json",
            contentType:"application/json;charset=utf-8",
            success:function(msg){
                var json = null;
                try
                {
                    json = eval('('+msg+')');
                }catch(e)
                {
                    alert("返回字符串不是JSON格式。");
                    return;
                }
                alert(msg);
            },
            error:function(err,status)
            {                
                alert(status);
            }
        });返回的error信息:parsererror,在网上找了一中午的帖子,愣是没找到是什么原因。。