I have mvc application on a button click i'm changing hidden field value but i'm unable to use Request.Form["hiddenfield"]
into private method ,
any way to use it?
Index.cshtml
<input type="hidden" name="hiddenfield" id="hiddenfield" value="true">
<button type="button" id="stop" class="btn btn-success">
<script>
if ($('#stop')) {
$('#stop').click(function (e) {
document.getElementById('hiddenfield').value = "false";
});
}
</script>
HomeController.cs
In private method i want to get this changed value do that i can do other stuff.
private async Task Process()
{
//unable to get hidden value using var test= Request.Form["hiddenfield"];
because its not controller method. but then how to check this changed hidden field value ?
As button click I can't call any mvc controller method because it is taking timme to hit method as another execution is already going on.