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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top