sending a list of strings from client to server

Discussion in 'ASP .Net' started by Guest, Aug 11, 2004.

  1. Guest

    Guest 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
     
    Guest, Aug 11, 2004
    #1
    1. Advertisements

  2. Guest

    TPS Guest

    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
     
    TPS, Aug 11, 2004
    #2
    1. Advertisements

  3. 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.
     
    Peter Rilling, Aug 11, 2004
    #3
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.