Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 10, 2012 03:25 PM by bruce (sqlwork.com)
Member
1 Points
12 Posts
May 10, 2012 01:48 PM|LINK
Hello ppl,
Could anyone please suggest me about the best practice of handling the exception in asp.net MVC3 Razor engine.
if you can share any links or code snippets it would be very much helpful for me.
Thanks,
Murthy.
All-Star
135174 Points
21682 Posts
Moderator
MVP
May 10, 2012 02:29 PM|LINK
global asax, application_error.
36882 Points
5451 Posts
May 10, 2012 03:25 PM|LINK
your logic should be in the controller. there should be no planed exceptions in the view. don't pass queries to a view, which causes the sql query to run in the view, alwas run the query in the view (use ToList()).
murthybsnvsn
Member
1 Points
12 Posts
Exception handling in MVC3 Razor view
May 10, 2012 01:48 PM|LINK
Hello ppl,
Could anyone please suggest me about the best practice of handling the exception in asp.net MVC3 Razor engine.
if you can share any links or code snippets it would be very much helpful for me.
Thanks,
Murthy.
ignatandrei
All-Star
135174 Points
21682 Posts
Moderator
MVP
Re: Exception handling in MVC3 Razor view
May 10, 2012 02:29 PM|LINK
global asax, application_error.
bruce (sqlwo...
All-Star
36882 Points
5451 Posts
Re: Exception handling in MVC3 Razor view
May 10, 2012 03:25 PM|LINK
your logic should be in the controller. there should be no planed exceptions in the view. don't pass queries to a view, which causes the sql query to run in the view, alwas run the query in the view (use ToList()).