I currently am using buttons on my view for the menu. So along the top of my view I have
@(Html.Kendo().Button() .Name("btnAddTeacher") .HtmlAttributes(new { type = "submit", value = "AddTeacher", name = "Command", title = "Add Teacher" }) .ImageUrl(Url.Content("~/Images/add-student-35.png")) .Enable(ElementaryProgress.Classes.Security.AllowSchoolEdit))
Now I would like to replace these buttons with a menu. However I can't seem to figure out how to pass the model within my routevalues in the call to the action. So my menu item looks like:
@(Html.Kendo().Menu() .Name("menu") .Items(items => { items.Add() .Text("Teacher") .Items(c => { c.Add() .Text("Add Teacher") .ImageUrl("~/Images/add-student-35.png") .Enabled(ElementaryProgress.Classes.Security.AllowSchoolEdit) .Action("EditMySchool", "School", new { vm=this.Model, Command="AddTeacher" }); }); }))So the problem is that when the call is made to my action on my controller, the parameter vm is null. So how do I set vm equal to the model on the view so that I can pass my viewmodel back to my controller?
Thanks in advance,
Lee