views:

418

answers:

2

hello,

Im using jquery autocomplete can I pass extraParams to webservice in asp.net ? and how will my [WebMethod] get it ?

+1  A: 

You pass an extra params function as follows:

$("#controlId").setOptions(
                    {
                        extraParams:
                        {
                            extra: function()
                            {
                                return "Something";
                            }
                        }
                    }
                );

You then retrieve this in your webservice using:

    string yourParam = <HttpContext Goes Here>.QueryString["extra"];
GenericTypeTea
10X alot, it's working!
haddar
No problem at all.
GenericTypeTea
A: 

anyone run across the actual 'function() {return " is returned in the extra querystring value?

brudyman
yes ,,, you can get the value like this HttpContext.Current.Request.QueryString["extra"];
haddar