I am coding a MVC5 internet application and would like to know how to set a value in Javascript
in a View
that can be retrieved in the View's
HTTP Post
method.
I have tried this View
code:
<input type="hidden" id="testHiddenField" value="test" />
With this Javascript
code:
$("#testHiddenField").val("test value set");
However, in the HTTP Post
method, I am not sure how to retrieve this value.
If the above code is not correct, what is the best way to retrieve a value that is set via Javascript
in a MVC View
in the HTTP Post
function for the View
?
Thanks in advance.