tags:

views:

65

answers:

1

I want to create a templating engine which sits on top of the asp.net webforms view engine. This is a bit of a shim to simplify an existing XSL based architecture. Instead of using XSL stylesheets, I'll use views. Essentially an end user will create a template by submitting aspx view code to my application. I would like to compile that view to a C# class and then render the HTML. Obviously the MVC framework is doing this for aspx files in the views folder but I don't know if that compiling functionality is exposed. Does anyone know how to manually compile a view stored in a string to a C# class or assembly?

A: 

Phil Haack has an example using the DLR. This means you're using Ruby or Python instead of C#, but it does work.

Craig Stuntz
Yeah. Unfortunately I think his source code zip is corrupted. Maybe a side effect of his blog's recent outage.
Matt Wrock