Wednesday, 9 April 2008

Packaging MonoRail View Components in an Assembly

I recently found myself in a situation where I wanted to package some view components in a separate assembly for reuse, in much the same way as you'd create an assembly of server controls in web forms/ASP.NET.

Obviously this means you need to get rid of any views or compile them into the assembly somehow. Taking a look into the Castle.MonoRail.ViewComponents source code, it turns out there is a "RenderText" method that you can use within your ViewComponent to output view text directly.

No comments: