SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    PHP Otaku Gibb's Avatar
    Join Date
    Jul 2004
    Location
    Texas
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Reload page after Download Window Close?

    I'm working on a site for my company where you build a list of stuff throughout the site, then download the list in a file. I have a session variable in VB.NET that keeps track of whether the list has been saved to a file or not.

    On the page where the list is downloaded, the Session variable is flipped when the download link is clicked, but until the page is refreshed, the top corner of my site still says the list is unsaved.

    Is there a way to basically Reload or Refresh the current page after the user closes the download window that pops up?

    Also, is there anyway to know if the user successfully downloaded the file, as opposed to just hitting "Cancel" and closing the download window?

    TIA for any assistance,
    -Gibb

  2. #2
    CSS & JS/DOM Adept bronze trophy
    Join Date
    Mar 2005
    Location
    USA
    Posts
    5,482
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is there a way to basically Reload or Refresh the current page after the user closes the download window that pops up?
    Not exactly. JS can't detect that. You could use JavaScript to reload the page after some delay after the link is clicked.

    Also, is there anyway to know if the user successfully downloaded the file, as opposed to just hitting "Cancel" and closing the download window?
    No.
    We miss you, Dan Schulz.
    Learn CSS. | X/HTML Validator | CSS validator
    Dynamic Site Solutions
    Code for Firefox, Chrome, Safari, & Opera, then add fixes for IE, not vice versa.

  3. #3
    PHP Otaku Gibb's Avatar
    Join Date
    Jul 2004
    Location
    Texas
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the reply. I guess a short delay before refresh could work. How would I do that?

    Forgive my ignorance, but I know very little about Javascript.

    I suppose I would want a function to run as soon as the "Download" link is clicked, which would refresh the page after a 1 or 2 second delay.

  4. #4
    PHP Otaku Gibb's Avatar
    Join Date
    Jul 2004
    Location
    Texas
    Posts
    454
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I found a solution for anybody who's interested:

    <input type="submit" name="filedownload" value="Download" onClick="setTimeout('window.location.reload()',300);" />

    Once the "Download" button is pressed, the page reloads after 300 milliseconds in the background.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •