I'll want to create a project using MVC and angular and i thought about using html like templates. This is the best practices? And If i use html, i'll lose security in my application, or other things beyond Razor?
Asked
Active
Viewed 1.6k times
0
-
1There's no "best practice". If you want to take some load off your server, do as much as you can in javascript client side with angular. If you'd rather create the html server side (for example you have different outputs depending on which role the user is in), perhaps razor is the better choice. The answer is: it depends – Alexander Derck Feb 25 '16 at 13:09
-
1http://forums.asp.net/t/2032101.aspx?What+is+the+difference+between+cshtml+and+html+ – Soner Gönül Feb 25 '16 at 13:10
-
Okay.. Thanks Alexander Derck!! – Lucas Gonçalves Feb 25 '16 at 16:54
-
Related: [Using Html instead of csHtml](http://stackoverflow.com/questions/18046247/using-html-instead-of-cshtml); I'd recommend editing this question to remove "best practices" and maybe (?) flagging this question as a dupe of the question I linked. I found this by searching for something very similar to the title of this question. Lucas, if you're still here I strongly recommend avoiding asking about "best practices" on SE sites. – jrh May 21 '17 at 03:04
1 Answers
4
Cshtml is basically razor view extension and any view renders in html finally. You need to use Razor in your application as it supports server side code but raw html does not.

8protons
- 3,591
- 5
- 32
- 67

Vinay Sinha
- 193
- 2
- 13