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

No members online now.

Forum statistics

Threads
473,989
Messages
2,570,207
Members
46,782
Latest member
ThomasGex

Latest Threads

Top