Re: frustration with events firing

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Hermit Dave (hermitd.REMOVE_at_CAPS.AND.DOTS.hotmail.com)
Date: 09/10/04


Date: Fri, 10 Sep 2004 20:36:12 +0100

you are sending the file to the user and you need to finish the current
request before the client can make another request. in this case user
Response.Redirect (it executes from client browser) and since the client is
still not done with the last request.. nothing will happen.

-- 
Regards,
Hermit Dave
(http://hdave.blogspot.com)
"Rob" <fiddler27@att.net> wrote in message
news:540e4d0b.0409101129.6746daeb@posting.google.com...
> ok, so im ready to absolutely throw my self right into the monitor,
> can anyone explain why certain events fire before others in asp.net?
> in my case, after some processing a final download aspx page calls a
> download function which writes a file to the browser.. yet after that
> is done I want the page to redirect to another page, but no matter
> what I try it wont redirect, I know there is something with the way
> .net works, I just cant figure it out.
>
> here is simplified version of code
>
> process....
> call downloadfile
>
> Sub downloadfile (fullfile as string)
>             Dim fstream As FileStream = File.Open(fullfile,
> FileMode.Open)
>             Dim fsize As Long = fstream.Length
>             Dim Buffer(CInt(fsize)) As Byte
>             fstream.Read(Buffer, 0, CInt(fsize))
>             fstream.Close()
>             Response.AddHeader("content-disposition", "attachment;
> filename=" + filename)
>             Response.BinaryWrite(Buffer)
>             Response.Redirect("main.aspx")<--- this does not fire at
> all?
> end sub
>
> after the open/save window comes up , the redirect never fires..
> thoughts appreciated.


Relevant Pages

  • Re: How to intercept error when httpRuntime maxRequestLength is ex
    ... Jos's comments of using a secondary progress window on the client to ... HttpRequest request = HttpContext.Current.Request; ... To redirect the client your server has to send back a response. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: ASHX Download Large File
    ... Set correct Content-Length. ... downloaded to the client. ... How can I make it appear before the download ... requests a file of a madeup extension and the request is sent to my ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Regulation of the websites access
    ... The redirect feature functions exactly the same. ... When you specify the destination to which to redirect the request, ... ISA Server sends the URL specified here to the Web ... The client Web browser then tries to access the object from ...
    (microsoft.public.isa)
  • RE: ASHX Download Large File
    ... downloaded to the client. ... How can I make it appear before the download ... requests a file of a madeup extension and the request is sent to my ... IHttpHandler which looks like this basically: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Response.Redirect
    ... When you redirect, a 302 response is sent back to the client. ... subsequently makes the request. ... But how do I add a header? ...
    (microsoft.public.dotnet.languages.csharp)