很简单,但是很实用
public string ViewHtml(DataGrid dg)
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
dg.RenderControl(new HtmlTextWriter(new System.IO.StringWriter(sb)));
return sb.ToString();
}
{
System.Text.StringBuilder sb = new System.Text.StringBuilder();
dg.RenderControl(new HtmlTextWriter(new System.IO.StringWriter(sb)));
return sb.ToString();
}