0

In the below code i am trying to display image inside a panel.But my image cannot access the image from C directory and place inside panel.Pls any one me to solve the issue

 docimg.ImageUrl = @"C:\Search\Seardoc\Documents\Desert.jpeg";
  imgPnl.BackImageUrl = docimg.ImageUrl;

 <asp:Panel ID="imgPnl" runat="server">
        <asp:Image ID="docimg" runat="server" Width="100px" Height="100px"  /></asp:Panel>
user3580909
  • 23
  • 1
  • 2
  • 8

1 Answers1

0

use file:/// before the image name

@"file:\\\C:\Search\Seardoc\Documents\Desert.jpeg";

Example

CSS background image URL failing to load

Community
  • 1
  • 1
शेखर
  • 17,412
  • 13
  • 61
  • 117