Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

lessons learned or mistakes made when using asp.net mvc

Tags:

asp.net-mvc

what are your top lessons learned when starting asp.net mvc that you would highlight to someone starting out so they can avoid these mistakes?

like image 732
leora Avatar asked Sep 07 '09 17:09

leora


People also ask

What should I learn before ASP.NET MVC?

You should start with . net Framework, then C#. Using C# you should be able to design Console & Desktop Apps. For Web apps then you should proceed to ASP.net & then you can move on to MVC Framework to design Web Apps.

Is ASP.NET MVC hard to learn?

It's really difficult to try and learn an entirely new language/framework under pressure. If you're required to deliver working software for your day job, trying to learn ASP.NET Core at the same time might be heaping too much pressure on yourself.


1 Answers

  • Use Html.Encode() everywhere you print data, unless you have a very good reason to not do so, so you don't have to worry about XSS
  • Don't hardcode routes into your views or javascripts - they're going to change at some point, use Url.Action() instead
  • Don't be afraid of using partial views
  • MVC is no silver bullet, first evaluate if it's indeed the best tool of choice for solving your problem.
like image 53
Tamas Czinege Avatar answered Sep 22 '22 19:09

Tamas Czinege