Does Razor syntax provide a compelling advantage in UI markup?

后端 未结 2 1625
花落未央
花落未央 2020-11-30 18:08

I notice Scott Guthrie is starting to mention Razor a fair bit on his blog but I\'m just not that sure that it\'s a good fit for my style.

Granted it\'s a fairly unf

2条回答
  •  温柔的废话
    2020-11-30 18:55

    Personally I really appreciate the reduction in how many escape characters are used. Using <% %> gets very tedious when compared to @{} and is not nearly as syntactically appealing.

    Moreover, writing a whole definition for the codebehind and page is simplified to a single @model model.

    As also noted by marcind, not having to always include runat=server is very nice also.

    Overall, I really appreciate using the Razor engine and find it not only makes things easier on me to develop but also makes code easier to read.

提交回复
热议问题