1

在 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 中显示图像。所以我想找到标签并想用空白字符串替换它。

谁能告诉我我该怎么做?

4

0 回答 0