2010-01-12 39 views
0

我試圖通過顯示一個aspx頁面像返回的圖像此顯示圖像

<asp:Image ID="ButtonImage" runat="server" 
     Width="200" 
     Height="113" 
     BackColor="LightGray" 
     ImageUrl="/Editor/OpenMedia.aspx?path=336!TestImage.jpg"/> 

OpenMedia.aspx

public partial class OpenMedia : MemberPage 
{ 
    protected void Page_Init(object sender, EventArgs e) 
    { 
     string path = Request.QueryString["path"]; 
     HASFile file = new HASFile(path); 

     HASConnection con = new HASConnection(ConfigurationManager.AppSettings["HASUrl"]); 
     HASReader reader = new HASReader(con); 

     reader.getFile(file, Response.OutputStream); 
     Response.ContentType = "image/jpeg"; 
    } 
} 

當我看與小提琴手響應該圖像正確返回,它在Firefox中正常工作,但不在IE中。這怎麼和IE不兼容?

回答

0

這竟然是一些我與測試圖像的腐敗地方以某種方式,Internet Explorer無法解決。 Firefox即使在腐敗的地方也可以顯示圖像。

0

嘗試顛倒順序:

protected void Page_Init(object sender, EventArgs e) 
{ 
    Response.ContentType = "image/jpeg"; 

    string path = Request.QueryString["path"]; 
    HASFile file = new HASFile(path); 
    HASConnection con = new HASConnection(ConfigurationManager.AppSettings["HASUrl"]); 
    HASReader reader = new HASReader(con); 

    reader.getFile(file, Response.OutputStream); 
} 
+0

根本沒有任何區別。 – 2010-01-12 16:17:55