C# 剑道TabStrip:在MVC4中将父模型传递给子动作
我在MVC 4中定义了剑道UI选项卡条:C# 剑道TabStrip:在MVC4中将父模型传递给子动作,c#,asp.net,asp.net-mvc,kendo-ui,kendo-asp.net-mvc,C#,Asp.net,Asp.net Mvc,Kendo Ui,Kendo Asp.net Mvc,我在MVC 4中定义了剑道UI选项卡条: @model SearchUserModel @(Html.Kendo().TabStrip() .Name("tabMain") .Items(items => { items.Add() .Text("Search") .Content(Html.Action("Form","SearchUser").ToString()).Selected(
@model SearchUserModel
@(Html.Kendo().TabStrip()
.Name("tabMain")
.Items(items =>
{
items.Add()
.Text("Search")
.Content(Html.Action("Form","SearchUser").ToString()).Selected(true);
items.Add()
.Text("Manage User")
.Action("Index", "ManageUser");
})
.Animation(false)
)
ChildAction“表单”与此父节点位于同一控制器“SearchUser”上
问题:如何将父级的SearchUserModel传递给“表单”/“SearchUser”子操作?您应该能够使用Html.Action()帮助程序的RouteValue参数传递模型,如下所示:
Html.Action("Form", "SearchUser", new { model = Model })
然后,您只需修改控制器操作以接受模型作为参数:
public ActionResult Form (SearchUserModel model)
{
}