Archive for the ‘ViewEngine’ Category

VS.NET 2012’s new features in “MVC 4, Razor v2”

August 24, 2012

Here are two cool enhancement in Razor v2! Enjoy reading!!

1. No need to use “@href” or “@url.content” anymore for resolving the Url. We can simply use “~” as we use it in ASP.NET development

Example:
< script src=”@Url.Content(“~/Scripts/jGrowl.js”)”>

can be just simply as below
< script src=”~/Scripts/jGrowl.js”>

Note: <space> has been added after “<” in < script> for the perfect view

2. Conditional attributes:

Please refer: http://vibrantcode.com/blog/2012/4/10/whats-new-in-razor-v2.html/

Advertisements

MVC 3 View engine Razor and comparision!

February 7, 2011

Benefits over Razor are

  1. Can be hosted outside ASP.NET
  2. Can unit test views (no need of controller or web-server)
  3. Better intellesense support on VS.NET
  4. Everything is encoded by default
  5. Executing it from a console app is possible
  6. Much cleaner
  7. There’s no need to specify the language, because it’s included in the extension
  8. No need to explicitly specify a master page
  9. No external dependencies as it has been shipped with MVC 3 (System.Web.Mvc.dll)
  10. and lot more

Below are the urls you could enjoy reading over the major 4 view engines, itโ€™s awesome. Just including here as it would help some one over there.

  1. http://channel9.msdn.com/coding4fun/articles/Developer-Review-Four-ASPNET-MVC-View-Engines
  2. http://ironshay.com/post/The-Big-View-Engine-Comparison-e28093-Razor-vs-Spark-vs-NHaml-vs-Web-Forms-View-Engine.aspx

ASP.NET MVC 3 & New view engine “Razor”!

February 6, 2011

Most of you must have heard about MVC 3 has been released few months ago with the big bang! It has come up with too many features and improvement. Thought of giving some quick info and links related to that.

Find below the link from Scottgu depicting about the same. Excellent one!

http://weblogs.asp.net/scottgu/archive/2010/11/09/announcing-the-asp-net-mvc-3-release-candidate.aspx


Top features:

  • New view engine called “Razor” with much simplified
  • Support for Multiple View Engines
  • Powerful hooks with Dependency Injection and Global Action Filters
  • Rich JavaScript support with unobtrusive JavaScript, jQuery Validation, and JSON binding
  • Streamlined validation with improved Model validation

Here is the pointer over Razor:

http://weblogs.asp.net/scottgu/archive/2010/07/02/introducing-razor.aspx


Web form Vs Razor syntaxt comparision and example from haacked.com, i loved this very much ๐Ÿ™‚

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

One more interesting part, yes..there is a tool you can convert WebForms(asp.net) Views to Razor (C# Only). Actually it was developed by the Telerik ASP.NET MVC team for internal use, but now it is available free over GitHub.com.

Here you go….https://github.com/telerik/razor-converter. There are some limitations with this tool, check it out there.

Enjoy playing with MVC 3!