Ajax传个对象传不成功!不知道错了那里!

Ajax传个对象传不成功!不知道错了那里!有空再研究。。。
 protected void Page_Load(object sender, EventArgs e)
    {
        AjaxPro.Utility.RegisterTypeForAjax(
typeof(AjaxDemo));
    }

    [AjaxPro.AjaxMethod()]
    
public string GetStr()
    {
        
return "Hello !!!!";
    }
传个字符串是没有问题的!
 AjaxDemo.GetStr(GetStr_callback);
    function GetStr_callback(res)
    {
        alert(res.value);
    }

但下面这样不行,取不到值!不知道什么原因!
  [AjaxPro.AjaxMethod()]
    
public ArrayList GetList()
    {
        ArrayList arr 
= new ArrayList();
        Person P 
= new Person();
        P.Name 
= "阿一";
        P.Sex 
= "";
        arr.Add(
"猪海");
        arr.Add(P);
        
return arr;
    }

ASPX.
 function GetList_callback(response)
    {
        if ( response.error !=null)
        {
            alert("Messagere:"+response.error.Message+"Type:"+response.error.Type);
            return ;
        }
       
       alert(response[0].value + "--"+response[1].Name+"--"+response[2].Sex);
    }
posted @ 2006-03-10 17:13  ansonpan  阅读(585)  评论(1编辑  收藏  举报