Asp.net 如何在HtmlTextWriter中读取和执行更改

Asp.net 如何在HtmlTextWriter中读取和执行更改,asp.net,htmltextwriter,Asp.net,Htmltextwriter,在ASP.NET站点中,我正在呈现GridView控件,以便将其详细信息导出到excel文件中 Response.ContentType = "application/vnd.ms-excel" Response.AppendHeader("Content-Type", "application/vnd.ms-excel") Dim stringWrite As System.IO.StringWriter = New System.IO.StringWriter Dim htmlWrite A

在ASP.NET站点中,我正在呈现GridView控件,以便将其详细信息导出到excel文件中

Response.ContentType = "application/vnd.ms-excel"
Response.AppendHeader("Content-Type", "application/vnd.ms-excel")
Dim stringWrite As System.IO.StringWriter = New System.IO.StringWriter
Dim htmlWrite As System.Web.UI.HtmlTextWriter = New HtmlTextWriter(stringWrite)
gridviewObject.RenderControl(htmlWrite)
Response.Write(stringWrite.ToString())
Response.End()
现在,它正在被渲染,但是gridview使用很少的图像来美化数据。 导出数据时,我不想在excel中显示图像。 所以我想找到标记并用空白字符串替换它

有人能告诉我怎么做吗