Passing a javascript array to a handler .ashx

J

JJ

I am using a handler (processImage.ashx) to display an image. The image is
displayed according to parameters passed in the querystring. The handerl is
called via some clientside javascript.

I want to send an array of unknown length to the handler. I am not sure
whether the querystring is the best place to do this. What's the best way to
send an array held in the client side javascript to the handler?

Thanks in advance,
JJ
 
B

bruce barker (sqlwork.com)

you can not post an image request, so the url is the only option other than a
prelimary ajax call. the url is restricted to about 2k. how you encode the
array depends on the array type. the most common is a array.join('|'), with a
matching split on the server side.

-- bruce (sqlwork.com)
 
S

Steven Cheng[MSFT]

Hi JJ,

I think Bruce means you should pass the image urls(or any array parameters)
either through url querystring or through AJAX xmlhttp request. Directly
manipulate binary content of image is not quite supported in client script
and also not effecient to pass such large content frequently.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


This posting is provided "AS IS" with no warranties, and confers no rights.


--------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top