5

For my job i have to make many small projects that require to send different mails and set up some html. I usually make these forms in Winforms. Now at this moment whenever i need to fill my html I take the string replace some values and have functions that write hardcoded table rows.

To make my job a little easier I was wondering if it was possible to import the razor engine(not sure if it's the right word choice) in my winforms project and simply pass a model to a CSHTML file which returns me the HTML in a string so i can mail it to coworkers.

If this is possible, instructions on how to do it are welcome.

Kind Regards Roxas

Dylan Snel
  • 671
  • 2
  • 7
  • 26
  • 2
    RazorEngine http://razorengine.codeplex.com/ https://github.com/Antaris/RazorEngine – jjchiw Feb 21 '14 at 13:36
  • 1
    Just a suggestion, why not add a Web API MVC solution to your project and create your content with WebAPI calls? Sort of a variation on [this](http://www.asp.net/web-api/overview/web-api-clients/calling-a-web-api-from-a-net-client) – jacqijvv Feb 21 '14 at 13:36
  • @jjchiw might possible be a better option actually, the only nice thing is if you had the solution you would have some nice intellisense and things designing your pages. – jacqijvv Feb 21 '14 at 13:43
  • Yes this is possible - see [Is it possible to use Razor View Engine outside asp.net](http://stackoverflow.com/questions/3628895/is-it-possible-to-use-razor-view-engine-outside-asp-net) – Justin Feb 21 '14 at 13:45

0 Answers0