Gunnar Peipman's ASP.NET blog

ASP.NET, C#, SharePoint, SQL Server and general software development topics.

Sponsors

News

 
 
 
 
 
DZone MVB

Links

Social

ASP.NET MVC: Comparing same view on ASP.NET and Razor view engine

I ported views of my ASP.NET MVC application from ASP.NET to Razor. Although Razor is very new it is very promising view engine because of shorter and cleaner syntax. In this posting I will show you same view on ASP.NET and Razor view engine. I like Razor one more but what do you think?

My contacts table on ASP.NET view engine is here. You can open both images on separate windows and switch between them to see differences.

Contacts index on ASP.NET

And here is the same view in Razor. Notice that ASP.NET MVC 3 RC has support for Razor syntax highlight. Click on image to view it at original size.

Contacts index on Razor

If you see these images at original size you see the effect.

For me Razor view is easier to read because there is less noise caused by template symbols. I think this view is not complex one. If there are more loops and conditionals in our view then I am sure ASP.NET version of it looks messier.

Comments

DotNetShoutout said:

Thank you for submitting this cool story - Trackback from DotNetShoutout

# November 26, 2010 7:01 PM

DotNetKicks.com said:

You've been kicked (a good thing) - Trackback from DotNetKicks.com

# November 26, 2010 7:03 PM

progg.ru said:

Thank you for submitting this cool story - Trackback from progg.ru

# November 26, 2010 7:04 PM

Twitter Trackbacks for ASP.NET MVC: Comparing same view on ASP.NET and Razor view engine - Gunnar Peipman's ASP.NET blog [asp.net] on Topsy.com said:

Pingback from  Twitter Trackbacks for                 ASP.NET MVC: Comparing same view on ASP.NET and Razor view engine - Gunnar Peipman's ASP.NET blog         [asp.net]        on Topsy.com

# November 26, 2010 8:03 PM
Leave a Comment

(required) 

(required) 

(optional)

(required)