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. Page won't postback after savefile dialog

Page won't postback after savefile dialog

Scheduled Pinned Locked Moved ASP.NET
sysadminquestion
1 Posts 1 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.
  • S Offline
    S Offline
    shockwavepulsar
    wrote on last edited by
    #1

    No postback after savefile dialog I finally got my page so you can save a file from the server to the local machine, however, once it is saved the page doesn't refresh itself or continue doing what it should, it just sits there! The download function is sent the address of the file to download and the name to call it as variables. Download function code: Sub test(ByVal strFilename, ByVal strDownloadFilename) Dim objStream, fso, objFilestream Dim intFileLength ' clear the buffer Response.Buffer = True Response.Clear() ' create stream objStream = Server.CreateObject("ADODB.Stream") objStream.Open() ' set as binary objStream.Type = 1 ' check the file exists fso = Server.CreateObject("Scripting.FileSystemObject") If Not fso.FileExists(strFilename) Then tbFilter1.txt = "File not found" End If ' get length of file objFilestream = fso.GetFile(strFilename) intFileLength = objFilestream.size objStream.LoadFromFile(strFilename) 'format strFileName If Len(Trim(strDownloadFilename)) > 0 Then strDownloadFilename = Trim(strDownloadFilename) Else strDownloadFilename = objFilestream.name End If ' send the headers to the users browser Response.AddHeader("Content-Disposition", "attachment; filename=" & strDownloadFilename) Response.AddHeader("Content-Length", intFileLength) Response.Charset = "UTF-8" ' output the file to the browser Response.BinaryWrite(objStream.Read) Response.Flush() ' tidy up objStream.Close() objStream = Nothing 'objFilestream.Close() objFilestream = Nothing fso = Nothing tbFilter1.Text = "Done!" End Sub I can step through past the end, but it doesn't DO anything! The text "Done!" never appears, and there is no postback. If I click something else, I get writing appearing in the background f the website. Why oh why?!?

    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