在本地测试完毕后,可以将GridView图片导出到word中显示,但是上传到服务器上以后导出来显示的叉图.
实现过程如下:
Gridveiw 中图片显示代码:
<asp:TemplateField HeaderText="图片" Visible="true">
<ItemTemplate>
<asp:Image ID="Image1" runat="server" ImageUrl='<%# getpictrue( Eval("pictrue")) %>' />
</ItemTemplate>
</asp:TemplateField>
后台C#代码:
获取图片路径:
public string getpictrue(Object s)
{
string a = Request.ApplicationPath;
string b = Request.UrlReferrer.Authority;
string st = ("http://" + b + "/"+ Request.UrlReferrer.AbsolutePath.Split('/').GetValue(1) + "/SImg/" + s.ToString()).Replace("textarea", "span"); return st;
}
到处到word 用response输出;
实现过程如下:
Gridveiw 中图片显示代码:
<asp:TemplateField HeaderText="图片" Visible="true">
<ItemTemplate>
<asp:Image ID="Image1" runat="server" ImageUrl='<%# getpictrue( Eval("pictrue")) %>' />
</ItemTemplate>
</asp:TemplateField>
后台C#代码:
获取图片路径:
public string getpictrue(Object s)
{
string a = Request.ApplicationPath;
string b = Request.UrlReferrer.Authority;
string st = ("http://" + b + "/"+ Request.UrlReferrer.AbsolutePath.Split('/').GetValue(1) + "/SImg/" + s.ToString()).Replace("textarea", "span"); return st;
}
到处到word 用response输出;
解决方案 »
- gridview求救。
- listbox鼠标经过行变色,光标变手型以及双击事件怎么做?
- windows身份验证连接自带数据库问题
- gridview update
- 关于弹出确认删除对话框的问题!!!
- 关于xmlhttpRequest
- IIS启动时提示:系统找不到指定的路径,不能与主机连接
- 200分,急问。为什么我的detalist在update是始终取到HtmlInputText的原有值,无法得到改变后的值
- 关于ajax定时获取数据的问题
- asp.net 几个简单的基本问题
- System.IndexOutOfRangeException: 索引超出了数组界限
- 关于 HttpPostedFile 批量上传文件的问题
图的地址对应的服务器上的路径你在本地看word当然没图了