Problem with displaying my Image
Here is my full problem so if anyone has any ideas or can offer some help, please let me know. I have a Website that will generate a Report and this Report takes some time to create. There is a MyReport.ASPX file that has a form1, Image1, and a ReportViewer control. There is also a MyReport.cs file that has C# code to generated a HTMLText string that the ReportViewer control will display. When I pull the Website up in the browser, the MyReport.cs file creates the Report before MyReport.ASPX ever gets called so my Image1 (which I need to display while the Report is being created) never gets displayed until AFTER 开发者_运维知识库the Report is created and displayed.
What do you suggest I do here? If I did not supply enough information, please let me know what else you need to know and I will gladly post it.
Thanks,
The below is in response to Derek.
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function(){
$(".loading").load("http://servername/Geocortex/Essentials/Web/SelectionReport1.aspx");
});
</script>
<%@ Page Language="C#" AutoEventWireup="true" Codebehind="App_Code/MyReport.cs" Inherhits="Geocortex.Essentials.WebFramework.SelectionReportPage" Culture="auto" UICulture="auto" %>
One method would be to move the report generating code to a webservice, or PageMethod within your page. Have your aspx page display an image, then once the page is loaded, make an ajax call to your webservice (or Page Method), using js or jquery, and update the page (remove the image and display the report returned from the webservice).
<div id="loading">
<img src="..."/>
</div>
Then using jquery in the document.ready event:
$(document).ready(function(){
$(".loading").load(url of page with reportviewer control);
});
精彩评论