Click here to Skip to main content
15,035,723 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

i have some tables, that is created dynamically and fill some data based on some conditions.i have added those tables dynamically some tables and i added all those tables in to div.
For sending email i need div's outer html.
how can i take div outer html from the server side.


advance thanks to all...................
regards,
Shefeek
Posted
Comments
DamithSL 25-Jun-12 5:00am
   
Is this HTML or ASP.net?
shefeekcm 25-Jun-12 5:45am
   
asp site

1 solution

Define div as server control by setting runat="server" for the div.
Then try something like:
C#
var sb = new StringBuilder();
myDiv.RenderControl(new HtmlTextWriter(new StringWriter(sb)));
string divOuterHMTL = sb.ToString();
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900