Can I obtain the rendered html of a gridview via webService call?

前端 未结 2 1395
一整个雨季
一整个雨季 2021-01-28 23:23

Is there a simple of of calling a webService method that Rebinds an asp.Net GridView control and returns its rendered html so that I can refresh the region that contains the gri

2条回答
  •  广开言路
    2021-01-29 00:01

    You can use Gridview.RenderControl() method.

     System.IO.StringWriter stringWrite = new System.IO.StringWriter();    
     System.Web.UI.HtmlTextWriter htmlWrite = new HtmlTextWriter(stringWrite);    
     GridView2.RenderControl(htmlWrite);
    
    public override void VerifyRenderingInServerForm(Control control)
        {
           // Confirms that an HtmlForm control is rendered for the
           // specified ASP.NET server control at run time.
           // No code required here.
        }
    

提交回复
热议问题