Sunday, May 19, 2024
Homepage · c#
 Popular · Latest · Hot · Upcoming
114
rated 0 times [  117] [ 3]  / answers: 1 / hits: 112492  / 11 Years ago, thu, october 24, 2013, 12:00:00

As in question. Is it possible to set variable in asp.net page in localStorage and retrieve it on the other page?



How to set localStorage variable in asp.net. Is it possible?
After that I could read variable using:



localStorage.getItem('UserID');

More From » c#

 Answers
52

I guess You can't. The whole point of local storage is that it is local and You can manipulate it only from javascript. If You need to pass values between server and client You need to use some transport technology - cookies, ajax calls, hidden fields etc. It will all depend on how your application is organized, what kind of information is being stored, its volume, whether you want to redirect or not, but in all cases this should be done using javascript since that's the only way to access data stored in localStorage.


[#74771] Tuesday, October 22, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
rocky

Total Points: 316
Total Questions: 108
Total Answers: 110

Location: Mali
Member since Sat, Feb 12, 2022
2 Years ago
;