嗨我被困在一个代码我不知道我做了什么错。 这是我得到的错误块。问题部分视图名称
这是函数调用
function GetDocumenttList(FID, CID) {
var fURL = "/ClaimEdit/AllDocumentList";
if (FID && CID) {
$.ajax({
type: 'GET',
url: fURL,
dataType: "html",
async: false,
data: { "folderID": FID, "claimID": CID, "page": 1 },
contentType: "application/json; charset=utf-8",
success: function (result) {
$('#partialdivDocumentList').html(result);
$('#partialdivDocumentList').css('display', 'block');
//....Now update Navigation List start.
$.ajax({
type: 'GET',
url: '/ClaimEdit/NavigationList',
datatype: "text",
async: false, data: { "parentID": FID, "claimID": CID },
contentType: "application/json; charset=utf-8",
success: function (result) {
$('#divNavigationList').html(result);
}
});
//....Now update Navigation List end.
},
error: function (request, status, error) {
alert(request.responseText);
}
});
}
}
这是鉴于 “AllDocumentList.cshtml”
@model PagedList.IPagedList<CRM.Core.ViewModel.Claim.ClaimDocumentViewModel>
@using PagedList.Mvc;
<table class="table-grid-3" cellpadding="0" cellspacing="0" border="0" width="100%">
<thead>
<tr>
<th width="60%">
Document
</th>
<th width="20%">
Date
</th>
<th width="20%">
User Name
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
{
<tr>
<td>
@Ajax.ActionLink(item.ClaimDocumentName, "DocView", new { claimDocID = item.ClaimDocumentID, path = item.ClaimDocumentPath + item.ClaimDocumentName }, new AjaxOptions() { HttpMethod = "GET", UpdateTargetId = "divPartidalDocView", InsertionMode = InsertionMode.Replace })
</td>
<td>
@Html.DisplayFor(modelItem => item.ClaimDocumentUploadDate)
</td>
<td>
@Html.DisplayFor(modelItem => item.UserName)
</td>
</tr>
}
</tbody>
</table>
Page @(Model.PageCount < Model.PageNumber ? 0 : Model.PageNumber) of @Model.PageCount
@Html.PagedListPager(Model, page => Url.Action("AllDocumentList", new { page, folderID = ViewBag.folderID, claimID = ViewBag.claimID }), PagedListRenderOptions.EnableUnobtrusiveAjaxReplacing(new AjaxOptions { HttpMethod = "GET", UpdateTargetId = "partialdivDocumentList" }))
和最后这是我的行动。
public ActionResult AllDocumentList(int folderID, int claimID, int? page)
{
ViewBag.folderID = folderID;
ViewBag.claimID = claimID;
Mapper.CreateMap<ClaimDocument, ClaimDocumentViewModel>();
var folderList = _ClaimDoc.GetClaimDocumentListByFolderIDClaimID(claimID, folderID);
var folderListModel = folderList.OrderBy(x => x.ClaimDocumentID).ToList();
var pageNumber = (page ?? 1);
return PartialView(folderListModel.ToPagedList(pageNumber, Common.Constants.PageSize));
}
我被困wiith这个错误在我的部分观点AllDocumentList没能找到,而寻找其加入“\ u0027” 我不是在MVC一大块,所以请给我生了如果问一些事情愚蠢。
不要评论你自己的问题,请更新它。 –
@AvneeshSrivastava是存储在〜/ Views/ClaimEdit文件夹中的AllDocumentList.cshtml视图吗? – wazdev
AllDocumentList.cshtml的位置是“〜\ Areas \ Claims \ Views \ ClaimEdit \ AllDocumentList.cshtml” –