Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / November 2007

Tip: Looking for answers? Try searching our database.

Changing icon in GridView, and back

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
gianfranco dalfiume - 19 Nov 2007 14:38 GMT
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&#224; 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.
bruce barker (sqlwork.com) - 19 Nov 2007 16:28 GMT
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)

> Hi all!
> I have a gridview with a templatefield and an imagebutton
[quoted text clipped - 30 lines]
>
> Thank you in advance.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.