我可以通过webService调用获取gridview的呈现的html吗? [英] Can I obtain the rendered html of a gridview via webService call?
本文介绍了我可以通过webService调用获取gridview的呈现的html吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
是否有一种简单的调用webService方法的方法,该方法重新绑定asp.Net GridView控件并返回其呈现的html,以便我可以刷新页面上包含gridview的区域?
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 gridview on the page?
也许可以使用jQuery.Load,但是在服务器端如何获取特定控件的渲染块?
I can use jQuery.Load maybe but on the server side how can I obtain a specific control's rendered block?
谢谢
推荐答案
您可以使用Gridview.RenderControl()方法.
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.
}
这篇关于我可以通过webService调用获取gridview的呈现的html吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文