Can Razor Generator be used for this?

Dec 16, 2011 at 3:58 PM

Razor generator may be what I'm looking for. I have a webbrowser view embedded into an application. I would like to use the Razor syntax for templating the html content to be sent to the view.

What kind of classes do the razor generator produce from the views?

 Are they dependant on anything else?

 I really want to just compile the CSHTML files to a library that doesn't rely on ASP.NET MVC. Is this something razor generator could be used for?

 

Thanks

Coordinator
Dec 16, 2011 at 4:14 PM
Edited Dec 16, 2011 at 4:35 PM

Try installing the http://nuget.org/packages/RazorGenerator.Templating package. There's a sample in it that will help you get started.It's similar to precompiled T4 templates in that it produces a class file from a razor template that has no dependencies on the Razor engine or MVC runtime.

Dec 16, 2011 at 4:54 PM

Thank you, this may just work.

Coordinator
Dec 17, 2011 at 1:23 AM

Also, check out http://haacked.com/archive/2011/08/01/text-templating-using-razor-the-easy-way.aspx