Hello
I'm posting some data from Jquery using Jquery.Post()
to an asp.net page. How to get the data in the POST request in asp.net page?
Thank you
NLV
Hello
I'm posting some data from Jquery using Jquery.Post()
to an asp.net page. How to get the data in the POST request in asp.net page?
Thank you
NLV
You can do this by passing querystring.but remember querystring name should be same in the posted page (Which is the parameter).
function ShowProjectInfo(projID) {
$.post("/PostedPage?projID=" + projID, function(data) {
alert(data);
});
}
Under Code behind page
public void PostedPage(string projID)
{
//code here
}
U can also do it with serialize object.
function ShowProjectInfo(projID) {
var data = $("#frmPrjListEntry").serialize();
$.post("/PostedPage",data, function(data) {
alert(data);
});
}
frmPrjListEntry is name attribute of form tag. serialize will contain the whole form collection in object.
Under Code page
public void PostedPage(class classname)
{
//code here
}
Okie, i found that you can get the values POSTed from JQuery to asp.net page using
Request.Form.AllKeys
Using the keys, get the value using
string value = Request.Form[key]
Thank you
NLV