Solved

response.redirect redirecting too fast, why?

Posted on 2006-07-12
3
296 Views
Last Modified: 2008-02-20
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
Comment
Question by:alexthecodepoet
  • 2
3 Comments
 
LVL 52

Accepted Solution

by:
Carl Tawn earned 500 total points
ID: 17094504
Try adding a Response.Flush() just before your file download code to flush the output buffer to the client.
0
 

Author Comment

by:alexthecodepoet
ID: 17094551
i tried putting Response.Flush(); in several different places but the same thing happens
0
 

Author Comment

by:alexthecodepoet
ID: 17102877
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

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question