q; not performed during debug

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

private void DownloadPDF(string fPath)
{
Response.Clear();
Response.ContentType = "Application/pdf";
Response.WriteFile(fPath);
Response.End();
}


private void Show(string file)
{
DownloadPDF(file);

int i =1; // not performed during debug
i=i+1;
}

While I am debugging the code above I noticed the breakpoint on i=i+1 is
never hit. What is problem and how I can resole this? After downloading the
file I need to perform some operations and display something on the user
interface.
 
You are calling Response.End in DownloadPDF. That ends the current request.
Those 2 lines of code should never be run - both in debug and release. So
everything is behaving as expected given the code you are running.
 
Response.End() causes an immdediate exit (by killing the current thread)
don't call it until you've done you additional work.

-- bruce (sqlwork.com)
 
Ok. Thanks for the reply. I am doing this.MyLabel.Text=â€Testâ€; just before
Response.End() and this does not have impact on the screen. What is problem
there?
 
Back
Top