Accepting a serialized form from jquery in asp.net
In asp.net mvc it's pretty easy to receive a form collection in a ajax page webmethod like:
public bool AddSomething(FormCollection form)
{
return true;
}
How do I receive serial开发者_如何学运维ized data in an asp.net page method:
[WebMethod]
public static string AddSomething(??)
{
//...
return true;
}
i am not sure what you are asking about but if you are talking about how to send form data in serialize way using ajax then you can try this...
url='your url'
$.post(url,$('#formId').serialize(), function(responseValue) {
alert(responseValue);
});
updated:
[WebMethod]
public static string AddSomething()
{
string foo = Request["form element name"];//example
return true;
}
精彩评论