I have an Action Link implemented in my Razor view as below
<input type="hidden" id="format"/>
@Html.ActionLink("Save", "SaveFile", "ExportService", "http", "hrmsapp.mysystem.com", "", new { fileformat = <hidden field value here> }, new { @id = "save" })
I need to pass the value of hidden field to this action link in parameter “fileformat”.
I could not find any way to do this. There are numerous threads talking about @using Html.Form with “post” method. However, I am not sure how to use form to post when I am having different domain hrms.mysystem.com. There is no overload in Html.Form for this purpose.
Is there any way to read the hidden field value in the action link code itself (without using form)?
All @Html.Form does is print up HTML. You don’t have to use it. You can just hard-code the HTML form with the action pointing to a different server, and post it.