I have a web application in ASP MVC 3. In development environment, everything works fine, in a production environment there is a page which throws a 500 error but not every time. For example when open this page for the first time it works, but when I do it 3 times it throws this 500 error.
I thought that maybe it could be a timeout issue, so I added this code in the web.config file:
<httpRuntime executionTimeout="3600" maxRequestLength="2147483647" />
but it didn’t solve the problem.
Any suggestions ?
EDIT
This is the action that calls the partial view :
public ActionResult _PopupDiscussion(int? id)
{
ViewBag.id = id == null ? null : id;
return PartialView("PartialViews/_PopupDiscussion");
}
then inside the partial view there is an AJAX request which calls this action:
public ViewResult PopupDiscussion_Content(DiscussionModelView model, int? id)
{
ViewBag.id = id;
// some code here
return View(model);
}
I tried to turn off custom errors like this :
<system.web>
<customErrors mode="Off"/>
</system.web>
but it didn’t work.
This was caused by calling an action inside the controller from a partial view.
I modified this by using
@Html.Partial()instead of@Html.Action()and everything works just fine