views:

3034

answers:

3

Hi friends,

I am trying to figure out how to get the parameters that are passed in the URL from a jquery plugin that I am using. Basically, I'm sending a POST ajax request to my web service and trying to use the URL parameters. But, they are always returned as nothing. I"m assuming this has to do with the fact that I'm in a POST.

Can anyone please provide some insight for me on how to accomplish this? Thanks!

+1  A: 

I'm unsure why you're choosing to use querystring parameters on an AJAX call. Unless there's a very specific reason, you should just post them as parameters to your web service method instead.

A: 

Hi I'm using the jQuery jqGrid plugin and by default it posts 5 or 6 parameters to the url. I was having trouble getting to those parameters and from looking at some of the php examples, it showed the method grabbing the parameters from the Form variables...I was just trying to see if there was a way I could do that. I'll see what I can do about posting them as parameters. . . just for giggles, is there a way that I would or could do this though?

briandus
I use jqgrid. It doesn't post in the URL (as querystrings) -- it posts everything as POST parameters. So, in ASP.NET, you should be able to get, for example, the requested page number as Request.Form("page").
JacobM
A: 

for ASP.NET....

you can get the POST parameters with Request["paramName"];

If your using a GET request with query string parameters then Request.QueryString["paramName"];

Mike