Good day all, what would be the best way to read a value from a text box in a view and to cast it into an integer in the corresponding controller?
View:
@{
ViewBag.Title = "Index";
}
<h2>Administration</h2>
<p>
Page number:
@Html.TextBox("pageNumber")
@Html.ActionLink("Fetch stats", "FetchStats", "Admin", null,
new { @style = "text-transform:capitalize;" })
</p>
Controller:
public ActionResult FetchStats(int pageNumber)
{
CurrentGameNumber = pageNumber;
[...]
return View("Index");
}