Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Download after the page loaded!

Download after the page loaded!

Scheduled Pinned Locked Moved ASP.NET
helptutorialquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Z Offline
    Z Offline
    Zeke Le
    wrote on last edited by
    #1

    How to open the "save as" dialog box to download a file automatically after the page has loaded? Anyone knows please help! Thanks Zeke

    F H 2 Replies Last reply
    0
    • Z Zeke Le

      How to open the "save as" dialog box to download a file automatically after the page has loaded? Anyone knows please help! Thanks Zeke

      F Offline
      F Offline
      FruitBatInShades
      wrote on last edited by
      #2

      Use RegisterStartupScript to add a script block that fires a URL to the file. Just look up RegisterStartupScript in the help :-D

      Z 1 Reply Last reply
      0
      • F FruitBatInShades

        Use RegisterStartupScript to add a script block that fires a URL to the file. Just look up RegisterStartupScript in the help :-D

        Z Offline
        Z Offline
        Zeke Le
        wrote on last edited by
        #3

        Thanks, I have looked up and found the method. But I really don't know how to write the client script to fires the URL to the file. Zeke

        1 Reply Last reply
        0
        • Z Zeke Le

          How to open the "save as" dialog box to download a file automatically after the page has loaded? Anyone knows please help! Thanks Zeke

          H Offline
          H Offline
          Heath Stewart
          wrote on last edited by
          #4

          The most common way that most web sites use is to include the following in your page header:

          <meta http-equiv="refresh" content="5;url=path/to/download.file">

          where 5 is the number of seconds before downloading begins. Don't forget the value of viewing web sites' source to figure out how they do things.

          -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups