Reputation: 4079
I have an interesting error which I couldn't debug and find information online. Got a screenshot of the error. Please see...
This is the details view of my controller. There are many records in that database table and some of them returns that error when I click the records on the list view. Most of them shows the page with no problems, but some of them does this. As you see in the picture, Model.Description has a value, and a long one, and it's far from being a null or empty value.
That is the Details controller which returns the db record to the view.
public ActionResult Details(string title, int id)
{
if (id == null)
{
return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
}
Page page = db.Pages.Where(p => p.MenuElement_Id == 2).First(p => p.Id == id);
if (page == null || HelperFuncs.URLFriendly(page.Title) != title)
{
return HttpNotFound();
}
return View(page);
}
FYI, before the error appears, controller returns the view with no problems. And Model.Description has value when it returns the view. After that, pressing F10 brings me to the view and shows up error which is shown in the below picture.
May be you experienced such an issue, could you please tell me where to debug and look for the solution of that error? If you need more information, I will provide what you need.
Upvotes: 0
Views: 774
Reputation: 133403
You don't need to use Url.Content()
, if you simply want to display text. So you should simply remove it.
Use
<div>@Modal.Description</div>
instead of
<div>@Url.Content(Modal.Description)</div>
Upvotes: 1