single variable store multiple value
-
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
-
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
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
-
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
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
-
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
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.
-
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.
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
-
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
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.