I'm trying to make a small table, which can set the amount of columns through an "input field". I generated the the input field by following code (+ button):
@Html.EditorFor(model => model.Columns.Count, new { @class = "text-center control-form", @id = "countID" })
@Html.ValidationMessageFor(model => model.Columns.Count)
<button type="button" class="btn btn-primary" onclick="location.href='@Url.Action("CreateTable", "Home", new { count = VARIABLEHERE })'">Update</button>
I basically try to set the input of the @Html.EditorFor(model => model.Columns.Count .. as parameter of the function, executed by the button.
I tried using @Model.Columns.Count, but that's not working, because the count doesn't change through the input field.
Any ideas how to fix this?