I want to extract form parameters, just like in java request.getParameter("blah")
How to do it in C#, presently I serialized my form with jQuery and sending to web method, there I want to extract it
ajax
$("#btn").click(function () {
alert($('#login').serialize());
$.ajax({
type: "POST",
url: "Default.aspx/Login",
data: "{'vals': '" + $('#login').serialize() + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
TINY.box.show({ html: msg.d, animate: false, close: false, mask: true, boxid: 'success', autohide: 3, top: 200, left: 500 });
}
});
});
});
code-behind
[WebMethod]
public static string Login(String vals)
{
//WHAT TO DO HERE SO THAT I CAN EXTRACT FROM THAT STRING
return vals;
}
I can see the data resurned by msg.d at the client, but thats something like this "uname=1&pwd=2". How to extract it?? please some one help me out. Also is there any way to access the webmethod without making it static?