4
Reply

What is the Difference Between Razor & Aspx Engine in MVC?

    Razor is new view engine came with MVC3 . It gives cleaner syntax and render clean HTML in comparison of Web Forms. Razor syntax is quit different from Web Form or classic asp.

    http://www.c-sharpcorner.com/UploadFile/a20beb/differences-between-razor-and-aspx-view-engine-in-mvc/

    Aspx View Engine - This view engine present in MVC 1 and MVC2. Whatever code you want to write in View you need specify like <% string str = "India" %> Razor Veiw Engine- It is supported in versions after MVC3. SYntax for this is like @for(int i=0;i<5;i++) {} Razor view engine code is more concise and clean than aspx view engine. There are mostly syntactical differences between these two view engines.

    It all boils down to syntax in your webpage view, but ASPX and Razor are pretty different view engines. Razor doesn't depend on the same pipeline that ASPX does. Because of that, I'd consider Razor to be just a parsing engine.One of the advantages of that is that you can have a Razor parser run against any string, where aspx needs an httpcontext and other heavyweight elements.