on ASP.net Weblogs
See other posts from ASP.net Weblogs
or by nmarun
Published on Mon, 28 Feb 2011 13:38:41 GMT Indexed on 2011/02/28 15:25 UTC
Read the original article Hit count: 314
This post is largely based off of Phil Haack’s article titled Templated Razor Delegates. I strongly recommend reading this article first. Here’s a sample code for the same, so you can have a look at. I also have a custom type being rendered as a table.
Now I can write an extension method just for this type.
Modified my view to make it a strongly typed one and included html to render my custom type collection in a table.
We get intellisense as well!
Just added some items in the action method of the controller:
Running this I get the output as:
Verdict: RazorViewEngine.Points += 1;
© ASP.net Weblogs or respective owner