Changing icon in GridView, and back

  • Thread starter gianfranco dalfiume
  • Start date
G

gianfranco dalfiume

Hi all!
I have a gridview with a templatefield and an imagebutton

<asp:TemplateField>
<ItemTemplate>
<asp:ImageButton ID="Riepilogo" runat="server"
CommandArgument="<%#((GridViewRow)Container).RowIndex%>"
ImageUrl="~/img/search.png"
CommandName="riepilogo" ToolTip="Riepilogo attività impianto"
onClick="prova" OnClientClick="src='img/blue_loader.gif'; Visible='True'"/>
</ItemTemplate>
</asp:TemplateField>

When i click that imagebutton, the onclientclick event changes the standard
image to a "waiting" animated gif.

The code for CommandName is something like that:
....
Response.ClearHeaders();
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment;
filename=output.pdf");
Response.ContentType = myStuff.getAppSetting("ContentTypePDF");
Response.Flush();
Response.BinaryWrite(pdf);
Response.End();
....

This generates a PDF files that pops up for the download.

Now i have to change the image back to normal (not waiting). How do i
accomplish this?

Thank you in advance.
 
B

bruce barker (sqlwork.com)

becuase the request is a file download, there is no browser notification
javascript can get of when the domaload is done. you can use ajax to poll the
server to for when the download is done. be sure the poll is non-session
page.

-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top