此代码用于编辑视图
@{Html.RenderAction("ActionNotes", "Prospects");}
在ActionNotes视图中编写ajax代码。
var $dt = @jQueryDataTable.Init("#tblActionNotes"
, new DataTableOption(Model.List.Items)
{
AjaxSource = Url.Action("ActionNotes"),
Dom = @IsOperator ? (((Model.UserRights & (int)CrmPermission.Add) == (int)CrmPermission.Add|| Model.TotalAccess) ? null : "<\'row-fluid\'<\'span6\'F><\'span6\'>><\'row-fluid\'r>t<\'row-fluid\'<\'span3\'i><\'span3\'l><\'span6\'p>>" ) : (((Model.RoleRights & (int)CrmPermission.Add) == (int)CrmPermission.Add) ? null : "<\'row-fluid\'<\'span6\'F><\'span6\'>><\'row-fluid\'r>t<\'row-fluid\'<\'span3\'i><\'span3\'l><\'span6\'p>>" ),
DeferLoading = Model.List.TotalItems,
CreateUrl = Url.Action("ActionNoteNew","Prospects", new { id = Model.ProspectId }),
Columns = new[] {
new DataTableColumnOption { Data="CreatedOn", Title="Date", Width="15%" },
new DataTableColumnOption { Data="CreatedByUserName", Title="Operator", Width="15%" },
new DataTableColumnOption { Data="ToOperatorName", Title="Assign Operator", Width = "15%"},
new DataTableColumnOption { Data="Note", Title="Note" },
new DataTableColumnOption { Data="FollowUpDate", Title="Followup Date", Width="15%" },
new DataTableColumnOption { Data="Type", Title="Type", Width="10%" },
new DataTableColumnOption { Data="Status", Title="Status", Width="10%" },
new DataTableColumnOption { Data="Id",Title = "Action", Width="80px", Render = "actionNoteActionRender", Sortable = false }
},
})
});
我使用此代码调用另一个控制器和视图在单个视图中显示两个不同的视图,使用此代码第二个视图正确显示我可以在(右键单击)页面源中看到编辑视图上的数据,但我无法显示编辑视图页面上的数据。
答案 0 :(得分:1)
使用..
解决此问题@{Layout = null;}
在编辑视图之前..
@{Html.RenderAction("ActionNotes", "Prospects");}