asp:ImageButton 在加载调试 ASP.NET 时损坏

发布于 2024-11-17 12:21:54 字数 283 浏览 6 评论 0原文

您好,我有一个 imageButton,当我加载 IE 7 时,它显示图片的图像已损坏,尽管当我进入 VS2010 中的设计时,它显示图片。

这是代码:

<asp:ImageButton ID="calendarImage" runat="server" ImageUrl="d:\mydocuments\ALM\ALM\ALM\imgs\calendar_button.jpg" Height="21px" Width="24px" />

谢谢, 格雷格

Hi I have a imageButton and when I load IE 7, it shows a broken image for the picture, although when I go into Design in VS2010 it shows the picture.

Here is the code:

<asp:ImageButton ID="calendarImage" runat="server" ImageUrl="d:\mydocuments\ALM\ALM\ALM\imgs\calendar_button.jpg" Height="21px" Width="24px" />

Thanks,
Greg

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

倾城月光淡如水﹏ 2024-11-24 12:21:54

为什么要尝试以这种方式设置 ImageUrl="d:\mydocuments\ALM\ALM\ALM\imgs\calendar_button.jpg"

您应该将这些图像放在您的 Website 文件夹中,然后设置路径,例如...

ImageUrl="~/imgs/calendar_button.jpg"

如果您确实想按照您建议的方式设置 ImageURL,我不会推荐它,但您可以这样做...

ImageUrl="d:\\mydocuments\\ALM\\ALM\\ALM\imgs\\calendar_button.jpg"

您需要使用路径中的双斜杠代替单斜杠

Why are you trying to set ImageUrl="d:\mydocuments\ALM\ALM\ALM\imgs\calendar_button.jpg" in this way ?

You should put these images in your Website folder, then set the path like...

ImageUrl="~/imgs/calendar_button.jpg"

If you really want to set ImageURL the way you are proposing, I would not recommend it, but you can do it like...

ImageUrl="d:\\mydocuments\\ALM\\ALM\\ALM\imgs\\calendar_button.jpg"

You need to use double slash instead single slash in path

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文