ASP.NET MVC ViewEngine.. WebForms Vs NVelocity vs NHaml vs Spark which is efficient?
.aspx gets the job done, everyone is familiar with it, zero learning curve, constant developement (etc etc), new things appearing on regular basis and I think it is quite feature rich
Imagine a situation where you will receive a lot of design stuff from your co-worker and you will start rewriting it to NHaml...wow, how geeky! I know it can be automated but...why?
But just because I have a hammer in my hand not everything for me is a nail. I CAN change view engine, but give me _concise_ reason to do so.
xample View: Web Forms
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true"
CodeBehind="List.aspx" Inherits="MvcApplication5.Views.Products.List" Title="Products" %>
<%= ViewData.CategoryName %>
<%= product.ProductName %>
(<%= Html.ActionLink("Edit", new { Action="Edit", ID=product.ProductID })%>)
<% foreach (var product in ViewData.Products) { %>
<% } %>
<%= Html.ActionLink("Add New Product", new { Action="New" }) %>
Example View: NHaml
%h2= ViewData.CategoryName%ul
- foreach (var product in ViewData.Products) %li = product.ProductName .editlink = Html.ActionLink("Edit", new { Action="Edit", ID=product.ProductID }) = Html.ActionLink("Add New Product", new { Action="New" })
Source :- http://haacked.com/archive/2008/12/08/asp.net-mvc-northwind-demo-using-the-spark-view-engine.aspx
http://www.slideshare.net/jesschadwick/introduction-to-aspnet-mvc-3353914
No comments:
Post a Comment