Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 313
  • Last Modified:

response.redirect redirecting too fast, why?

Hello,

I have an ASP.NET 1.1 C# web based wizard.  Once users click the button to go from step 2 to step 3, the code behind the scenes on step3.aspx will automatically create a popup download box.  The problem, however, is that the page never refreshes for step 3.

I do this:

step2.aspx:
    Response.Redirect("step3.aspx");

step3.aspx
     Output File To Download();


but, step3.aspx is never rendered in the browser.  all that happens when you click the button on step2, is that the Output File To Download gets called and step3.aspx is never rendered.  Does anyone know how to make it so that step3.aspx will be rendered, and THEN the file is downloaded?

Thanks
0
alexthecodepoet
Asked:
alexthecodepoet
  • 2
1 Solution
 
Carl TawnSystems and Integration DeveloperCommented:
Try adding a Response.Flush() just before your file download code to flush the output buffer to the client.
0
 
alexthecodepoetAuthor Commented:
i tried putting Response.Flush(); in several different places but the same thing happens
0
 
alexthecodepoetAuthor Commented:
actually, you were almost right.  Putting Response.Flush() AFTER the line that actually makes the user download a file is what made it work.

thanks
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now