I need to send a JavaScript array via querystring to my .ashx. In my .ashx (handler), I will have a method that needs to be analyzed through each value in the array and populate the general list
Just trying to think about how to do this by passing it to querystring, as well as how to take this querystring value and convert it to a C # array to pass this to my method in my .ashx.
So, to pass an array to querystring, I assume it will be something like this
var javascriptArray = [1212, 32321, 42342];
now pass it to querystring, iterates over each value in the array first and adds it to the variable in javascript. So I get something like this
var querystringArray = "1212, 32321, 42342";
and ultimately querystringArray will be passed as a querystring parameter for the url that hits my .ashx.
Secondly, as soon as I take this parameter, suppose I just use or create an ultility function that will split the lines and insert them and return a C # array. Then pass this to my method.
Just wondering if there is an easier or better way to do all this. Thoughts? I'm still not the best with JavaScript syntax.
source
share