MVC 3 without using Razor?

Is the Razor engine really necessary to create an MVC3 site with EditorFor syntax? Almost all the examples I've seen use Razor. Worked on our first MVC project and probably wouldn’t be on the edge of the bloodstream ...

+6
source share
3 answers

The short answer is no, you do not need to use Razor. IMHO, you really need to review the transition from the ASPX viewer. Razor is a very stable platform for generating HTML.

New view

+7
source

You can also use web form browsing. if you want to convert a razor view to a web form, you can find the vs extension here . In addition, telerik has a tool to convert it, you can find it here on the telerik website

+1
source

I agree with everyone here. -10,000 for using aspx syntax :)
Go for a razor .. it will take you 2 minutes to learn. See the syntax link at:

http://haacked.com/archive/2011/01/06/razor-syntax-quick-reference.aspx

Just remember that @Something expects output and there will be an HtmlEncode for you (which is huge +++), but that @ {some other code} does not output the output to the stream. So @ Html.TextBoxFor () works fine @ {Html.TextBoxFor ())} I believe that nothing will work, and you will be wondering why there is no way out. Besides the ones that were made, this is amazing and you will never want to go back to aspx again. Seriously .. you will pick it up as soon as possible.

0
source

Source: https://habr.com/ru/post/891222/


All Articles