*Why i still get this feeling that, still, MonoRail has cleaner View than ASP.NET MVC*
I know what you mean. Personally, I prefer the dynamic nature of Brail and NVelocity when working in views. Having to deal with C# and its static-ness in the view seems a little...cumbersome. Perhaps there will be an IronRuby view engine in time. On the plus
side, its nice to have intellisense again ;)
I'm also not fond of using page events for the views. In fact, I've deleted the codebehind for all of my .aspx files.
I'm not familiar with MonoRails section/template bits - can you give me some details?
In MonoRail, a ViewComponent is very similar to a server control. It allows you to re-use portions of your UI across views and you can set various properties on it. One of the most useful things about viewcomponents is how you can override sections of a viewcomponent to support custom rendering. For example, a repeater component might look like this:
<% component Repeater, { @id: "someId", @datasource: someCollecton }: section item: output "this is an item: ${item}" end section alternatingItem: output "this is the alternating item: ${item}" end end %>
JeremyS
Member
506 Points
99 Posts
Re: Helper Development - How's about Section Template?
Dec 13, 2007 07:42 AM|LINK
I know what you mean. Personally, I prefer the dynamic nature of Brail and NVelocity when working in views. Having to deal with C# and its static-ness in the view seems a little...cumbersome. Perhaps there will be an IronRuby view engine in time. On the plus side, its nice to have intellisense again ;)
I'm also not fond of using page events for the views. In fact, I've deleted the codebehind for all of my .aspx files.
For databinding my server controls I'm using the CodeExpressionBuilder found at http://weblogs.asp.net/infinitiesloop/archive/2006/08/09/The-CodeExpressionBuilder.aspx. Instead of having to set the DataSource from codebehind I can do something like this:
In MonoRail, a ViewComponent is very similar to a server control. It allows you to re-use portions of your UI across views and you can set various properties on it. One of the most useful things about viewcomponents is how you can override sections of a viewcomponent to support custom rendering. For example, a repeater component might look like this: