I have a model Like :
public class Post
{
public int PostId { get; set; }
public int ParentId { get; set; }
public string PostTitle { get; set; }
public IEnumerable<Post> ChildPosts { get; set; }
}
I have also a add action in my Controller that return my above Model to add.cshtml view. Now come to the point my application running mode I get a exception (Like Database connection Exception). Now I want to display my exception message in add.cshtml page.
Is it possible? If yes. How can i done this work. Please explain with example code.