Ian Vink
Ian Vink

Reputation: 68750

Kendo UI Grid: Form post on a column with MVC 4

I have a grid which currently uses an ActionLink in a column:

columns.Bound(p => p.ID)
      .Template(@<text>
                @Html.ActionLink("Edit", "Index", 
                                 "ManageUser", new { id= @item.ID}, null)
                </text>);

The above Action in our app has been changed and can now only receive Posts. How do I change the above code to post the id to the ManageUser controller when the link is clicked in the column?

I have tried to put a form in the column like this, but it doesn't render the form tags:

columns.Bound(p => p.ID)
      .Template(@<text>
                @Html.BeginForm("Index", "ManageUser", new {id= @item.ID})
                                {
                                    <a   "javascript to post">@item.ID</a>
                                }
                </text>);

Upvotes: 0

Views: 1181

Answers (1)

Petur Subev
Petur Subev

Reputation: 20203

Try to change your Grid to be rendered like this to the page.

from: $(Html.Kendo().Grid...)

to:

 ${
     Html.Kendo().Grid...
      .Render();
  }

And see if the forms are generated. ALso you will need to either submit the forms programatically or add submit button.

Upvotes: 1

Related Questions