Shape to String or something....

Topics: General
Jan 6, 2013 at 1:24 PM
Edited Jan 6, 2013 at 3:28 PM

Help, please!

Need a to render a string by means of a Razor template (from shape probably) being on a driver content.

The following function: string RenderView(Controller controller, String viewName, object model) {}

requires a ControllerContext which I cannot get from a driver or don't know how.

Now I have to use WebClient to get the string from some controller - seems rather ugly ... but works

Does somebody know if is it possible to use the function or another being in the context of a content driver?

Jan 11, 2013 at 8:51 PM

Perhaps this project contains the code you need - it uses shapes (Razor templates) as a templating mechanism for email messages:

Jan 12, 2013 at 10:41 AM


Thank  you very much, seems very promising!

Jan 12, 2013 at 10:48 AM

You're welcome. You may also be interested in RazorMachine, an open source project that enables you to process Razor templates in a standalone fashion (meaning that you can process Razor templates outside of a HTTP context).