NHaml. What is it and what does it eat with.
NHaml is a .NET implementation of the popular Rails Haml . Therefore, first, let's try to understand what Haml is . It stands for XHTML Abstraction Markup Language , i.e. it is a markup language for simplified XHTML generation . We already have tools in our arsenal to achieve such goals: XSLT, ASP.NET Web Forms, or even better ASP.NET MVC and others. NHaml provides an alternative way to build your page layout, and if XHTML itself is a very verbose language, then NHaml is imbued with the spirit of conciseness . Abbreviations, keywords, block designation - all aimed at reducing the amount of code while maintaining its clarity. Let's look at the following piece of code:
ASP.NET MVC (vinaigrette from the code and html ) You can write the same markup (and save the logic of its construction), and so on ... Read more ...
ASP.NET MVC (vinaigrette from the code and html ) You can write the same markup (and save the logic of its construction), and so on ... Read more ...
<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true"
CodeBehind="List.aspx" Inherits="MvcApplication5.Views.Products.List" Title="Products" %>
<%= ViewData.CategoryName %>
<% foreach (var product in ViewData.Products) { %>
<%= product.ProductName %>
(<%= Html.ActionLink("Edit", new { Action="Edit", ID=product.ProductID })%>)
<% } %>
<%= Html.ActionLink("Add New Product", new { Action="New" }) %>