Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplay waiting image while exporting to excel
    text
    copied!<pre><code> &lt;asp:ScriptManager ID="ScriptManager1" runat="server"/&gt; &lt;asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="UpdatePanel1"&gt; &lt;ProgressTemplate&gt; &lt;asp:Image ID="Image1" ImageUrl="waiting.gif" AlternateText="Processing" runat="server" /&gt; &lt;/ProgressTemplate&gt; &lt;/asp:UpdateProgress&gt; &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional"&gt; &lt;ContentTemplate&gt; &lt;asp:ImageButton ID="imgBtn_PDF" runat="server" ImageUrl="../images/pdf.png" Width="34" Height="17" Style="padding-top: 7px" OnClick="imgBtn_PDF_Click" /&gt; &lt;/ContentTemplate&gt; &lt;Triggers&gt; &lt;asp:PostBackTrigger ControlID="imgBtn_PDF" /&gt; &lt;/Triggers&gt; &lt;/asp:UpdatePanel&gt; In the above code am using the update panel i am displaying waiting message with progress bar while exporting to PDF.The image is displayed when i use the trigger as asynchronous postback but am not able to export to PDF.But when use postbacktrigger am not able to display the waiting message.Below is my codebehind code to export to excel Response.ContentType = "application/pdf"; Response.AddHeader("content-disposition", "attachment; filename=" + Path.GetFileName(pdfFile)); sourceFile = new FileStream(pdfFile, FileMode.Open); long FileSize; FileSize = sourceFile.Length; byte[] getContent = new byte[(int)FileSize]; sourceFile.Read(getContent, 0, (int)sourceFile.Length); sourceFile.Close(); Response.BinaryWrite(getContent); </code></pre> <p>In the above code am adding a header of type PDF,opening the file in open mode and storing the content in getContent of bytes then reading the whole file through bytes and exporting throgh BinaryWrite </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload