• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 315
  • 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

Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

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