且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在WinForms应用程序中编译ASPX

更新时间:2022-10-15 08:17:56

Rick Strahl发表了一篇文章,如何在这个位置: http://www.west-wind.com/presentations/aspnetruntime/aspnetruntime .ASP 。我知道有一种方法可以调用一些内部的.NET Framework方法,但是我不记得他们在做什么。


I'm writing a WinForms application that sends email messages (like a mail merge).

I'd like to use ASP.Net's rendering engine to render the HTML bodies of the messages.

What's the simplest way to get the rendered output of a single ASPX page without the entire ASP.Net runtime?

To make things harder, I'd prefer to compile the ASPX at runtime so that it can be modified without rebuilding the application. However, this is not a requirement; if it's too difficult, I'll give up on it.

Rick Strahl posted an article how to do this at this location: http://www.west-wind.com/presentations/aspnetruntime/aspnetruntime.asp. I know there is a way to call some internal .NET Framework methods but I can't remember what they are off hand.