ITsolutionWizard
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.
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"));
}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.
ASKER