sending a list of strings from client to server

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
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
 
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

Back
Top