sending a list of strings from client to server

G

Guest

I have a list of strings in the client side. I want to send them to the
server side processing.
I tried Page.RegisterHiddenField and then in the client wrote the list of
strings as comma separated values. But now the problem of delimetors comes.
(what if the strings already has ',' etc).

Is there any other elagant way to send a list of strings to the server side?

Thanks,
Senthil
 
T

TPS

Senthil

Try delimiting them with another char like | or ~ or # or something that you
know is not in your strings.

Then split them back apart like this;

string[] myList = myFormVar.Split(new Char [] {'#'});

TPS
 
P

Peter Rilling

Another alternative would be to dynamically generate the hidden fields on
the client for as many number of entries that you have. That way the
strings do not need to be delimited.
 

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,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top