FluentHtml

Find an introduction to using FluentHtml in these blog posts:

Also, MvcContrib.Samples.UI illustrates the basic usage of FluentHtml,

TIP: Be sure to include MvcContrib.FluentHtml.xml in the same folder with the DLL. FluentHtml is pretty well covered with XML comments, which show up in Intellisense.

TIP: Make sure to add the following key to your Web.config file. Otherwise you must add an import directive to every view in which you use FluentHtml.

    <system.web>
        <pages>
	    <namespaces>
	        <add namespace="MvcContrib.FluentHtml"/>

More complete documentation is coming soon

Last edited May 17, 2009 at 8:27 PM by timtas, version 3

Comments

dotnetchris Mar 16, 2011 at 5:22 PM 
I took a look at your blog samples and I give this project a 2.5/5. I really like the javascript and id implications but the overall expressiveness of this tool is very poor. I think you should replace alot of your fluent methods to have a single object htmlAttributes anonymous object to set stuff like style, class, etc html attributes.

Also the inheritance stuff that's going on that you do this. to invoke the methods is sketchy at best, you would be far better off emulating the Html. helper class and just pick a root name, FHtml?

mertner Sep 22, 2010 at 4:50 PM 
Ok, thanks for the heads-up.

JeremyS Sep 21, 2010 at 3:29 PM 
@mertner

Yes, there are potential performance implications by making use of expression trees, although as with anything it depends on context. Having a few helpers on a page probably isn't going to be an issue, but if you have hundreds then it may well be a problem.

In future, please post comments and queries to the mailing list (http://groups.google.com/group/mvccontrib-discuss) - the wiki comments are not monitored.

mertner Sep 20, 2010 at 9:14 PM 
Is it true that there are serious performance implications of using the FluentHtml helpers, because the compiled lambda expressions cannot be cached? If so, this page should be updated with a BIG FAT RED WARNING to unsuspecting users.