一、<asp:image> 比较智能。它能根据加载自己的页面的位置,动态调整最后生成的HTML。保证图片路径不错。
二、可以使用Request.ApplicationPath获取应用程序根路径(string cssPath = HttpRequest.ApplicationPath + "/css/css.css";)
三、ResolveUrl  详见(msdn)
<img src='<%= ResolveUrl("~/images/top.gif") %>'>
<td height="20" background='<%= ResolveUrl("~/images/top.gif") %>'></td>

相关文章:

  • 2022-12-23
  • 2021-07-19
  • 2021-11-20
  • 2021-11-02
  • 2021-12-10
  • 2021-08-28
  • 2021-12-19
  • 2021-12-30
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-11-02
  • 2022-02-15
  • 2022-01-10
  • 2021-12-22
相关资源
相似解决方案