Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. single variable store multiple value

single variable store multiple value

Scheduled Pinned Locked Moved ASP.NET
question
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Socheat Net
    wrote on last edited by
    #1

    Dears, I got a trouble, I trying to deploy web page to receive data posted by client by "GET" method. I have one variable name "myvar". I want to add value to that variable when user input it in same session id. The result shoulb be like this" myvar ="value1,value2,value3,..." value is depend on client inputted. Anyone any idea or that? Thanks,

    Socheat

    S 1 Reply Last reply
    0
    • S Socheat Net

      Dears, I got a trouble, I trying to deploy web page to receive data posted by client by "GET" method. I have one variable name "myvar". I want to add value to that variable when user input it in same session id. The result shoulb be like this" myvar ="value1,value2,value3,..." value is depend on client inputted. Anyone any idea or that? Thanks,

      Socheat

      S Offline
      S Offline
      Sandeep Mewara
      wrote on last edited by
      #2

      Your question is not clear. How is user adding values? Only way to have multiple values in a variable is string concatenation. If you want to keep adding on, just do something like myvar = myvar + ',' + newvalue;

      Sandeep Mewara Microsoft ASP.NET MVP 2012 & 2013 [My Blog]: Sandeep Mewara's Tech Journal! [My Latest Article]: HTML5 Quick Start Web Application

      S 1 Reply Last reply
      0
      • S Sandeep Mewara

        Your question is not clear. How is user adding values? Only way to have multiple values in a variable is string concatenation. If you want to keep adding on, just do something like myvar = myvar + ',' + newvalue;

        Sandeep Mewara Microsoft ASP.NET MVP 2012 & 2013 [My Blog]: Sandeep Mewara's Tech Journal! [My Latest Article]: HTML5 Quick Start Web Application

        S Offline
        S Offline
        Socheat Net
        wrote on last edited by
        #3

        HI, Let me same in exmple. I hage 2 pages, page1.aspx and page2.aspx 1. user1. page1.aspx send request to page2.aspx with method "GET" --> page2.aspx?search=hello 2. user1 again. input next value then redirect to page page2.aspx with same method --> page2.aspx?search=world What I want to see result in page2.aspx is show all value that user inputted. saerch=hello,world Anyway to store value like that? Regards

        Socheat

        A 1 Reply Last reply
        0
        • S Socheat Net

          HI, Let me same in exmple. I hage 2 pages, page1.aspx and page2.aspx 1. user1. page1.aspx send request to page2.aspx with method "GET" --> page2.aspx?search=hello 2. user1 again. input next value then redirect to page page2.aspx with same method --> page2.aspx?search=world What I want to see result in page2.aspx is show all value that user inputted. saerch=hello,world Anyway to store value like that? Regards

          Socheat

          A Offline
          A Offline
          AContractor
          wrote on last edited by
          #4

          Have you tried using a temporary cookies to store each search term submitted to page2? The methods Asp.net uses to store state (viewstate, hidden fields, etc) are generally designed to work with POST requests so I don't think there is any client-side feature that will work. You could also manage a string of submitted requests in javascript but the advantage of the cookie is that all the processing can be done on page2.aspx and return the cookie to the user after each request.

          S 1 Reply Last reply
          0
          • A AContractor

            Have you tried using a temporary cookies to store each search term submitted to page2? The methods Asp.net uses to store state (viewstate, hidden fields, etc) are generally designed to work with POST requests so I don't think there is any client-side feature that will work. You could also manage a string of submitted requests in javascript but the advantage of the cookie is that all the processing can be done on page2.aspx and return the cookie to the user after each request.

            S Offline
            S Offline
            Socheat Net
            wrote on last edited by
            #5

            HI, thank for your reply, i have used all but it seem not success 1. Cookie, will have problem if borwser disabled cookie. I will try find another way Thanks

            Socheat

            A 1 Reply Last reply
            0
            • S Socheat Net

              HI, thank for your reply, i have used all but it seem not success 1. Cookie, will have problem if borwser disabled cookie. I will try find another way Thanks

              Socheat

              A Offline
              A Offline
              AContractor
              wrote on last edited by
              #6

              True, cookies will not work if the user has them turned off. I think you might need to just come up with a custom solution for this.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups