日期:2014-05-17 浏览次数:20661 次
var json='{ "menu":[{"Role_ID":"2","Customer_ID":"155","Brands":"Chloe;","Country_ID":"96;"},{"Role_ID":"-1","Customer_ID":"497","Brands":"Chloe;","Country_ID":"96;"}]}';
$.ajax({
url: "RoleFunc.aspx/Convert",
type: "POST",
contentType: "application/json",
dataType: 'json',
data: '{"strJson":' + json+ '}',
success: function(result) {
alert(result);
},
error: function() {
alert("error");
}
});
public class CustomerRole
{
public string Role_ID { get; set; }
public string Customer_ID { get; set; }
public string Brands { get; set; }
public string Country_ID { get; set; }
}
[WebMethod]
public static string Convert(string strJson)//error
{
return strJson;
}
[WebMethod]
public static string Convert(CustomerRole strJson)//可以,但是这个strJson的obj为空
{
&