I am using the jquery ajax method on my aspx page, which will call the web method in the code behind. Currently, the web method accepts a couple of parameters, such as first name, last name, address, etc., which I pass from the jQuery ajax method using
data:JSON.stringify({fname:firstname,lname:lastname,city:city})
now my requirement has been changed so that the number and type of parameters to be passed are not fixed for the ex.parameter combination, maybe something like fname, city or fname, city or city, lname or fname, lname, city or something else. So the web method should be such that it accepts any numeric parameters. I was thinking about using arrays for this, as described here .
But I do not understand how I can determine which and how many parameters were passed to the web method for inserting / updating data in the database. Please can someone help me with this?
thank
source
share