Add namespaces
using System.Text;
using System.IO;
using System.Web.UI;
using System.IO;
using System.Web.UI;
and the code is
public string RenderGridView()
{
StringBuilder sb = new StringBuilder();
StringWriter sw = new StringWriter(sb);
HtmlTextWriter hw = new HtmlTextWriter(sw);
myGridView.RenderControl(hw);
return sb.ToString();
No comments:
Post a Comment