I need to create a hidden variable with the result of Url.Action
. Following code does not produce the required result. What need to be corrected to produce the required result?
Present output
<input name="/Controller/Action" type="hidden" value="{ Id = hiddenUrl }" />
Required output
<input id="hiddenUrlName" type="hidden" value="/Controller/Action" />
CODE
<div class="loader">
@Html.Hidden(@Url.Action("Action", "Controller"),new { Id = "hiddenUrl"})
</div>