IN MVC-4 Razor view I have a html table with 2 columns. 1st columns shows a field and also stores it as a hidden field. 2nd column of table has a <a>
clicking on it it redirect to some other control and action.
<tbody>
@foreach (var row in Model.Conversions)
{
<tr>
<td>@(Html.DisplayFor(m => row.LastUpdatedDate))
@(Html.Hidden("DateFrom",@row .LastUpdatedDate))
</td>
<td><a href="@Url.Action("ExchangeRateDetails", "ExchangeRate", new { currencyCode = @row.CurrencyCodeFromTo })">+</a>
</td>
</tr>
}
</tbody>
Inside action I am trying to read hidden field value but it is null. Here is my code:
public virtual ActionResult ExchangeRateDetails(string currencyCode)
{
var dat = Request.Form["DateFrom"];
}
Problem:
I am finding hidden field value as null. My expectation is it should have value coming form hidden field. I cant pass this value as a query string. Can you please guide and help me how I can read hidden field values in action ?
Much thanks for your guidance and helping me.
Thanks