Send email of ASP.net Page HTML
let say I have shopping cart I send all detail to one page name as emailsender.aspx
this page read all cart information(products,qty,price) from session and show it in datarepeater control then i want this page html so i开发者_JS百科 can email this ....
how can i achieve it?
To get the HTML that a control produces, you could use code below, found here.
public string RenderControl(Control ctrl)
{
StringBuilder sb = new StringBuilder();
StringWriter tw = new StringWriter(sb);
HtmlTextWriter hw = new HtmlTextWriter(tw);
ctrl.RenderControl(hw);
return sb.ToString();
}
精彩评论