像
Image.
ImageUrl这样的服务器控件使这很容易,但尝试在IMG html控件后面的代码中实现相同的功能并不是那么简单.
例如,使用Asp:Image服务器控件并将ImageUrl属性设置为“〜/ Images / Test.jpg”,无论我将代码放在哪个目录中都能正常工作.(asp.net将tilde目录转换为相对)
解决方法
使用Page.ResolveUrl(“〜/ …..”);
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。