I found the Problem:
In the Layout of the View I have a coment form:
<!-- Comments form container -->
<div class="comentsform">
<!-- Comments form -->
@{ Html.RenderAction(MVC.Comment.Create()); }
</div>
<!-- Comments form container closed -->
The Controller is:
public virtual PartialViewResult Create()
{
return PartialView();
}
The issue here is that I also have a JSON Action to send the comment by jQuery:
[HttpPost]
[ValidateAntiForgeryToken]
public virtual JsonResult Create(CommentViewModel commentViewModel)
{
CommentDto comentDto = Mapper.Map<CommentViewModel, CommentDto>(commentViewModel);
_commentService.Create(comentDto);
commentViewModel.Result = HeelpResources.CommentViewModelResultMsgOk;
return Json(commentViewModel);
}
So it seems that, when the Layout is rendered coming from a Form POST action, it will search for all the [HttpPost] Actions of the Html.RenderAction presents in the Layout.
In this case, and because I have a Html.RenderAction with an [HttpPost] Action of type JsonResult, the all result View is converted in a JSON response.
So now, the only thing I have to do is to change the name of the JSON Action to public virtual JsonResult CreateSend for example, and Problem Solved!
Thanks again for the availability of all to help.