Grid -> Column -> Form Post

2 posts, 0 answers
  1. Kevin
    Kevin avatar
    1 posts
    Member since:
    Jan 2016

    Posted 29 Feb Link to this post

    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:

                   .Columns(columns =>
                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:

    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.

  2. Vasil
    Vasil avatar
    1541 posts

    Posted 07 Mar Link to this post

    Hello Kevin,

    Please check out this thread where the problem is discussed.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET AJAX banner
Back to Top