简体   繁体   English

HTML.RenderAction无法与jQueryDataTable一起使用

[英]Html.RenderAction not working with jQueryDataTable

Html Razor code HTML Razor代码

this code use in Edit view 此代码在“编辑”视图中使用

@{Html.RenderAction("ActionNotes", "Prospects");}

Ajax code Ajax代码

write ajax code in ActionNotes view. 在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 }
                                                     },
                                    })
        });

i use this code for call another controller and view for display two different view in single view, using this code second view is display properly and i can see data on edit view in (right click) page source but i can not display data on edit view page. 我使用此代码调用另一个控制器,并在单个视图中查看以显示两个不同的视图,使用此代码第二个视图正确显示,并且我可以在(右键单击)页面源中的编辑视图上看到数据,但是我无法在编辑时显示数据查看页面。

solve this issue using.. 解决这个问题

@{Layout = null;}

in Edit view before.. 在之前的“编辑”视图中。

@{Html.RenderAction("ActionNotes", "Prospects");}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM