I am attempting to post to an action in the controller from a custom button in the Grid component. At first the Grid would render the form outside of the column, this was fixed by {}.Render() which appears to generate the form in the correct location.
My problem is that the items being passed to the form are always null, regardles:
I'll simply my example:
@{Html.Kendo().Grid(Model) .Name("IterationGrid") .Sortable() .Columns(columns => { columns.Tempate(@<text> using (Html.BeginForm("RemindEmployee", "Evaluations", FormMethod.Post)) { Html.Hidden("employeeID", item.Employee.EmployeeID); Html.Hidden("reviewID", item.ReviewId); Html.Hidden("fullname", item.Employee.Fullname); <input type="submit" name="Remind" value="Remind" class="btn btn-primary btn-k-grid" /> }@</text>).Title("Action"); }).Render(); }As I mentioned this appears to work fine, and the Controller has:
[HttpPost]public ActionResult RemindEmployee(int? employeeID, int? reviewID, string fullname) { }Though the parameters are always passed as null. What's the best way to handle this example here?
Note: I've already used some javascript $.post() to do the same thing, but I would like to know the proper way to get the above to work with hidden forms for my own benefit.