Link to home
Start Free TrialLog in
Avatar of ITsolutionWizard
ITsolutionWizardFlag for United States of America

asked on

mvc, local storage

i have the codes in mvc / c# below. The "CA' actually came from javascript localstorage from previous pages.
How can I get the local storage value and pass into MVC controller below?
I don't want to hard codes in html hidden value in cshtml.


public ActionResult AdditionalInfo()
        {
         return View(getvalue("CA"));
        }

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Snarf0001
Snarf0001
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ITsolutionWizard

ASKER

Thanks but we have to local storage
Local storage is a client-side only feature. If you want to send something from LS back to the server, then you have to read it out via Javascript and either plug it into a hidden form field, or submit the data to the server directly from Javascript.