i call an action controller in my view and when i set break point and watch the act of ajax function it work correctly on code behind but when back to function it not run 'success:function' and return error
$.ajax({
type: "POST",
url: "/GetListContents",
data: { _PageID: PageID, _LangID: LangID, _BoxTypeID: 6, _ListTypeID: 8, _Count: CurPageIndex },
cache: false,
dataType: 'html',
success: function (html) {
$("#dynamicBody").html(html);
$("#dynamicFooter").html("Hello");
},
error: function (xhRequest, ErrorText, thrownError) {
$("#dynamicBody").html(xhRequest.status);
$("#dynamicBody").html(ErrorText);
}
});
the GetListContents work on code behind but the result is error
tnx for advance
and sorry for poor english
Update
this is my action controller code
[HttpPost]
public PartialViewResult GetListContents(int _PageID, int _LangID, int _BoxTypeID, int _ListTypeID, int _Count)
{
dynamic cOut = GetListContent(_PageID, _LangID, _BoxTypeID, _ListTypeID, _Count);
return PartialView("DynamicPagingBoxInfo",null);
}
public dynamic GetListContent(int _PageID, int _LangID, int _BoxTypeID, int _ListTypeID, int _Count)
{
List<ipMedia_PageContentsCache> PageContent = new List<ipMedia_PageContentsCache>();
ListPageDataProvider.GetDynamicBoxContent(ref PageContent, _PageID, _LangID,_Count * 10);
ViewBag.PageListContents = PageContent;
ViewBag.CurPageIndex = _Count;
return PageContent;
}
Update ||
more explain :
my partial view use viewbag to render page and get data from code behind
this partial view for first time that run on page request work fine but when i want render it with ajax,ajax function return error!
my view bag has same structure in first time and in ajax call