protected void Page_Load(object sender, EventArgs e)
{
AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxDemo));
}
[AjaxPro.AjaxMethod()]
public string GetStr()
{
return "Hello !!!!";
}
传个字符串是没有问题的!{
AjaxPro.Utility.RegisterTypeForAjax(typeof(AjaxDemo));
}
[AjaxPro.AjaxMethod()]
public string GetStr()
{
return "Hello !!!!";
}
AjaxDemo.GetStr(GetStr_callback);
function GetStr_callback(res)
{
alert(res.value);
}
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;
}
public ArrayList GetList()
{
ArrayList arr = new ArrayList();
Person P = new Person();
P.Name = "阿一";
P.Sex = "男";
arr.Add("猪海");
arr.Add(P);
return arr;
}
ASPX.









