【发布时间】:2011-07-08 15:02:10
【问题描述】:
在 ASP.NET 中引用图像以在 IIS 上进行实时部署的正确方法是什么?
以下工作在开发和生产中:
<asp:ImageButton ID="ibnEdit" runat="server" OnClick="ibnEdit_Click" ImageUrl="~/App_Themes/Default/images/one.png" Visible="false" ToolTip="Edit" />
以下内容都不起作用:(为什么不呢?)
<img src="~/App_Themes/Default/images/two.gif" />
以下内容在开发中有效,但在生产中无效:
<img src="../App_Themes/Default/images/two.gif" />
【问题讨论】:
-
您确定您的映像已部署在生产环境中吗?
-
@是与开发环境相同路径的图像吗??
标签: asp.net image relative-path