First of all, I believe that it is not a RadControls problem, but a general AJAX case. I have a webpage that generates an Excel file on the server, and the page uses AJAX to update the status (as it is a long process).
The following is the (partial) codes that I use:
Me.imgStatus.ImageUrl = "~/Images/tick.jpg"
Me.imgStatus.AlternateText = "Done"
Me.RadAjaxManager1.ResponseScripts.Add("window.location.href='DownloadFile.aspx';")
"Downloadfile.aspx" is another file that prompts the user to Open or Save the Excel (instead of displaying on within IE). The following is the code-behind in Downloadfile.aspx.vb:
Response.Clear()
Response.ContentType = "application/x-msdownload"
Response.AddHeader("content-disposition", "attachment;filename=WAT_ASWSalesWithGPByBrandCustomer_" & Format(Now(), "yyyyMMdd") & ".xls")
excelFile.SaveXls(Response.OutputStream)
Now, my problem: the image "imgStatus" sometimes does not show up, and there is no Red cross on the web page. When I right-click the location of "imgStatus", and select "Show picture", the "Tick.jpg" loaded.
I think it is "Response.Clear()" that prohibits the displaying of "imgStatus". To ensure that "imgStatus", i.e. the tick.jpg, shows, should I add one more post-back (thus delay the page redirection). Is there anyway to overcome this?