Display an Image using C# in Web Application
- by Josh
Hello again,
I have a Web Application that I built a C# class in that generates a Report. This report takes nearly 40 seconds to generate because it searches hundreds of folders for certain files. So I was hoping there was a way to display a "Loading.." icon as this report is generating. I have a gif stored in my Images folder that would be perfect. The research that I've done at this point mostly talks about picturebox's and image controls that can hold the image but I was hoping there was just a way of displaying the image above the report while its being created.
The Web Application is from a Web ADF Geocortex website and again I created a C# class that generates this report. Below is some code that may help.
/// <summary>
/// Generates HTML for the current report using the data in
/// the given table.
/// </summary>
/// <param name="reportLayers">The layers to include in the report.</param>
/// <returns>
public override string GenerateReportHtml(List<ReportLayer> reportLayers)
{
StringBuilder htmlString = new StringBuilder();
StringWriter stringWriter = new StringWriter(htmlString);
HtmlTextWriter writer = new HtmlTextWriter(stringWriter);
string holdAPI = "";
List<string> exclusions = GetExcludedFields();
foreach (ReportLayer layer in reportLayers)
{
string[] strFiles = null;
Boolean val = false;
if (layer.Layer.Name == "Bottom Hole Location (OP)")
writer.RenderBeginTag(HtmlTextWriterTag.P); // <p>
writer.RenderBeginTag(HtmlTextWriterTag.Strong); // <strong>
writer.Write(layer.Layer.Name);
writer.RenderEndTag(); // end </strong>
writer.RenderEndTag(); // end </p>
writer.WriteBreak(); // <br />
foreach (ReportFeature feature in layer.ReportFeatures)
{
// each feature will be in a table
writer.RenderBeginTag(HtmlTextWriterTag.Table); // <table>
foreach (ReportField field in feature.ReportFields)
{
string fieldName = field.Alias;
if (!exclusions.Contains(fieldName))
{