ASP.Net from Windows

  • Thread starter Thread starter Brian Taylor
  • Start date Start date
B

Brian Taylor

I want to email rendered and data driven html content from a Windows
program. So I though it may be quickest to create an asp.net page or
control, load it up in Windows, render it to a string and send the string as
the email content.

Is this possible? Is this an easy way of producing html? Are their other
simple options?

Brian
 
You could create a data-driven ASP.NET site. Then from your windows app do
an HTTP GET to make a web request and get the HTML for the site. If this is
a winform you could use the HTTPWebRequest class to do this.
 
Hi Brian,

I think Bryant's suggestion on using the httpwebrequest to get web page
content is quite good if you already have a web application running and
accessable. Here are some reference on using httpwebrequest component:

#ASP.NET Common Web Page Class Library - Part 3
http://www.codeproject.com/aspnet/EWSWebPt3.asp

#C# sample for retrieving html content from any websites
http://www.dotnetspider.com/Technology/Tutorials/HtmlRetrieve.aspx

Also, if the html content you want to email is not very complex, you can
consider using a plain txt file to store the html template and then just
programmatically format it via various datas. Thanks.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx
 
Thanks guys - this is great information. It looks like this will do the job
and be simple to implement. I'll give it a go.

Brian
 
Back
Top