2013-01-22 104 views
0

我創建了一個正在保存在Page_Load(object sender, EventArgs e)方法中的動態圖像。
我加載樣圖像:正在顯示圖像未顯示在ASP頁面上

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server"> 
    <p> 
     &nbsp;</p> 
    <img alt="aa" class="style1" longdesc="aa" 
     src="file:///C:/project/Image/hours.png" /> 
</asp:Content> 

但唯一的一點是:
enter image description here


我知道這是一種愚蠢的問題,但我不能使它工作..任何一個可以指出我在哪裏做錯了?

+0

嘗試像'〜/ Image/hours.png' google'相對路徑和絕對路徑' – MethodMan

回答

10

您無法與客戶端上的文件系統進行交互。

您需要使用相對路徑或絕對路徑引用服務器上的映像。

1

您需要在服務器上使用相對或絕對路徑。看起來像「〜/../ Image/hours.png」。