I am passing a javascript array via Request.QueryString["cityID"].ToString(), but it shows me an error of “invalid arguments”:
blObj.addOfficeOnlyDiffrent(Request.QueryString["cityID"].ToString(),
Request.QueryString["selectTxtOfficeAr"].ToString());
The method declaration looks like:
public string addOfficeOnlyDiffrent(string[] cityID, string selectTxtOfficeAr) { }
Your method
addOfficeOnlyDiffrentis expecting a string array arguement incityIDwhereas you are passing a singlestringtype object to your method in call. I believe yourcityIDis a single string so you can remove the array from the method declaration. In your method call.the above represents a single string, not a string array.
If your query string contains a string array, then values are probably in string representation, separated by some character, for example
,. To pass that string to the method, you can callstring.Splitto split the string to get an array.EDIT:
From your comment, that your query string contains:
You can do the following.