开发者

asp:ImageButton getting broken when loading debugging ASP.NET

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\im开发者_运维问答gs\calendar_button.jpg" Height="21px" Width="24px" />

Thanks, Greg


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜