简体   繁体   中英

Get Html from a Url in ASP.NET MVC

I need to save a page from url - This page is in my own application - in html format. This html will then be send by email to a user. Any anyone knows how?

Well, you'll have to do it at the server to be able to e-mail - so at worst, simply:

using(WebClient client = new WebClient()) {
    string html = client.DownloadString(address);
}

It might also be possible to do it directly within MVC - perhaps RenderPartial ?

您可以创建结果过滤器,也可以覆盖控制器的OnResultExecuted方法以访问呈现的页面。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM