-
Razor is fun…ny
Microsoft Asp.Net Razor is a sort of “PHP” markup language for Microsoft Web Pages(Views, Partial Views etc etc). For sure better than Asp Classic or Aspx BUT As the special language char is @ does not require explicit closing of the code-block you can find very tricky situation (escaping CSS with a double @@ is the easiest one) For example inside a loop, with a custom template when you need the correct relative url path given by the server (using the “~” operator) you have to write something like this: @(Html.DevExtreme().SelectBox() .DataSource(LanguageItems) .DisplayExpr(“Description”) .ItemTemplate(@<text> <div class=”custom-item iconNav”> <img class=”lang-image” src=’~/Content/icons/@(“”)<%= ImageSrc %>’) /> <div class=”lang-description”><%= Description %></div> </div></text>) ) Where in…