allanmark
asked on
Web button with image added via source - image not displayed in browser
Greteings
I have a page with various button(s) - the default ASP.NET button!. The ASP source has been modified to add an image via teh background-image property. This appears to work fine - button shows with image , in designer. When I "View in Browser" ther is NO image displayed. What gives? What do I need to do?
My source:
<asp:Panel ID="Panel1" runat="server" BorderStyle="Outset" BorderWidth="2px" Height="50px"
Width="930px">
<asp:Button ID="btnInsert" runat="server" Text=" Insert" Width="85px"
Style="text-align: center; background-repeat: no-repeat; background-image: url(D:/School_Keeper_ASP/I mages/inse rt.bmp); background-position:left center;
right: 846px; position: absolute; top: 474px" />
<asp:Button ID="btnCancel" runat="server" Text=" Cancel" Width="85px"
Style="text-align: center; background-repeat: no-repeat; background-image: url(D:/School_Keeper_ASP/I mages/canc el.bmp); background-position:left center;
left: 396px; position: absolute; top: 472px" />
</asp:Panel>
I have a page with various button(s) - the default ASP.NET button!. The ASP source has been modified to add an image via teh background-image property. This appears to work fine - button shows with image , in designer. When I "View in Browser" ther is NO image displayed. What gives? What do I need to do?
My source:
<asp:Panel ID="Panel1" runat="server" BorderStyle="Outset" BorderWidth="2px" Height="50px"
Width="930px">
<asp:Button ID="btnInsert" runat="server" Text=" Insert" Width="85px"
Style="text-align: center; background-repeat: no-repeat; background-image: url(D:/School_Keeper_ASP/I
right: 846px; position: absolute; top: 474px" />
<asp:Button ID="btnCancel" runat="server" Text=" Cancel" Width="85px"
Style="text-align: center; background-repeat: no-repeat; background-image: url(D:/School_Keeper_ASP/I
left: 396px; position: absolute; top: 472px" />
</asp:Panel>
Your urls for the images start with D:/ (and thus file system based) and i am sure the browser is having issues with that. Please make sure the urls are either relative or absolute web paths. I hope that helps.
in the browser
right click on the image broken and see the property and see what path that broken image is getting...so that you can see why your image is broke.
right click on the image broken and see the property and see what path that broken image is getting...so that you can see why your image is broke.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
To everyone, thanks for your help!!
Rejojohny - spot on !!
Rejojohny - spot on !!