473,385 Members | 1,325 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Breakpoints after Response.Redirect in ASP.NET 2.0

I'm having an issue with an ASP.NET website after upgrading to ASP.NET
2.0. The website makes use of a central authentication service (CAS)
provided at the university I work for. Each page checks a session
variable, and if it is not present, does a Response.Redirect to a
webpage for the CAS passing a url parameter for the url to post back
to. The CAS provides a page for the user to log into, validates the
username and password, and then POSTs encrypted data back to the page I
provided. The information is then decrypted and validated, and if the
user was properly logged in, they are allowed to continue.

The code all seems to run fine. However, the problem I am having is
that after this authentication process I cannot hit breakpoints. That
is, if I place a breakpoint on the page before this Redirect, execution
breaks, and I can step through my code. However, if I put a breakpoint
after the Redirect, execution will not break.

Anyone know how to make my breakpoints function properly with this
off-site redirect?

Thanks,
Eric

Aug 17 '06 #1
5 4537
re:
if I place a breakpoint on the page before this Redirect, execution
breaks, and I can step through my code. However, if I put a breakpoint
after the Redirect, execution will not break.
See : http://support.microsoft.com/kb/312629/EN-US

If you use the Response.End, Response.Redirect,
or Server.Transfer method, a ThreadAbortException exception occurs.

The Response.End method ends the page execution and shifts the execution
to the Application_EndRequest event in the application's event pipeline.
The line of code that follows Response.End is not executed.

This problem occurs in the Response.Redirect and Server.Transfer
methods because both methods call Response.End internally.

To work around this problem, use one of the following methods:

1. For Response.End, call the HttpContext.Current.ApplicationInstance.CompleteRe quest
method instead of Response.End to bypass the code execution to the Application_EndRequest event.

2. For Response.Redirect, use an overload, Response.Redirect(String url, bool endResponse)
that passes false for the endResponse parameter to suppress the internal call to Response.End.

For example: Response.Redirect ("nextpage.aspx", false);

That will prevent Response.End from being called internally,
which will allow your code to continue executing.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
<ve****@gmail.comwrote in message news:11**********************@74g2000cwt.googlegro ups.com...
I'm having an issue with an ASP.NET website after upgrading to ASP.NET
2.0. The website makes use of a central authentication service (CAS)
provided at the university I work for. Each page checks a session
variable, and if it is not present, does a Response.Redirect to a
webpage for the CAS passing a url parameter for the url to post back
to. The CAS provides a page for the user to log into, validates the
username and password, and then POSTs encrypted data back to the page I
provided. The information is then decrypted and validated, and if the
user was properly logged in, they are allowed to continue.

The code all seems to run fine. However, the problem I am having is
that after this authentication process I cannot hit breakpoints. That
is, if I place a breakpoint on the page before this Redirect, execution
breaks, and I can step through my code. However, if I put a breakpoint
after the Redirect, execution will not break.

Anyone know how to make my breakpoints function properly with this
off-site redirect?

Thanks,
Eric


Aug 17 '06 #2
Sorry, I don't think I made the problem very clear. The issue is not
that breakpoints aren't hit in the code directly after the redirect.
The issue is that after redirecting to the CAS site, I can't hit
breakpoints _anywhere_ in my application, ever.

So, for example, lets say the page that CAS posts to has a button on
it, and lets say I put a breakpoint in both the button handler and in
the login page before the redirect to CAS. I will hit the breakpoint
before the redirect, and I can step along through the code until the
redirect. Then, in the browser, the page changes to the CAS login. I
log in, and am directed back to my site on a completely different page.
Now, when I press the button, the button handler executes correctly
(which I verify by having it write something to the database), but
execution does not break at the breakpoint that is placed in the button
handler. When I go into the code now, and look at the breakpoint I
added, it has a warning sign, and says "The breakpoint will not
currently be hit. No symbols have been loaded for this document."

Thanks,
Eric
Juan T. Llibre wrote:
re:
if I place a breakpoint on the page before this Redirect, execution
breaks, and I can step through my code. However, if I put a breakpoint
after the Redirect, execution will not break.

See : http://support.microsoft.com/kb/312629/EN-US

If you use the Response.End, Response.Redirect,
or Server.Transfer method, a ThreadAbortException exception occurs.

The Response.End method ends the page execution and shifts the execution
to the Application_EndRequest event in the application's event pipeline.
The line of code that follows Response.End is not executed.

This problem occurs in the Response.Redirect and Server.Transfer
methods because both methods call Response.End internally.

To work around this problem, use one of the following methods:

1. For Response.End, call the HttpContext.Current.ApplicationInstance.CompleteRe quest
method instead of Response.End to bypass the code execution to the Application_EndRequest event.

2. For Response.Redirect, use an overload, Response.Redirect(String url, bool endResponse)
that passes false for the endResponse parameter to suppress the internal call to Response.End.

For example: Response.Redirect ("nextpage.aspx", false);

That will prevent Response.End from being called internally,
which will allow your code to continue executing.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
<ve****@gmail.comwrote in message news:11**********************@74g2000cwt.googlegro ups.com...
I'm having an issue with an ASP.NET website after upgrading to ASP.NET
2.0. The website makes use of a central authentication service (CAS)
provided at the university I work for. Each page checks a session
variable, and if it is not present, does a Response.Redirect to a
webpage for the CAS passing a url parameter for the url to post back
to. The CAS provides a page for the user to log into, validates the
username and password, and then POSTs encrypted data back to the page I
provided. The information is then decrypted and validated, and if the
user was properly logged in, they are allowed to continue.

The code all seems to run fine. However, the problem I am having is
that after this authentication process I cannot hit breakpoints. That
is, if I place a breakpoint on the page before this Redirect, execution
breaks, and I can step through my code. However, if I put a breakpoint
after the Redirect, execution will not break.

Anyone know how to make my breakpoints function properly with this
off-site redirect?

Thanks,
Eric
Aug 17 '06 #3
Eric,

Are you running

Response.Redirect("nextpage.aspx");
or
Response.Redirect ("nextpage.aspx", false);

?

Also, are you running, in web.config,

<compilation debug="true">
or
<compilation debug="false">

?

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
<ve****@gmail.comwrote in message news:11*********************@i42g2000cwa.googlegro ups.com...
Sorry, I don't think I made the problem very clear. The issue is not
that breakpoints aren't hit in the code directly after the redirect.
The issue is that after redirecting to the CAS site, I can't hit
breakpoints _anywhere_ in my application, ever.

So, for example, lets say the page that CAS posts to has a button on
it, and lets say I put a breakpoint in both the button handler and in
the login page before the redirect to CAS. I will hit the breakpoint
before the redirect, and I can step along through the code until the
redirect. Then, in the browser, the page changes to the CAS login. I
log in, and am directed back to my site on a completely different page.
Now, when I press the button, the button handler executes correctly
(which I verify by having it write something to the database), but
execution does not break at the breakpoint that is placed in the button
handler. When I go into the code now, and look at the breakpoint I
added, it has a warning sign, and says "The breakpoint will not
currently be hit. No symbols have been loaded for this document."

Thanks,
Eric
Juan T. Llibre wrote:
re:
if I place a breakpoint on the page before this Redirect, execution
breaks, and I can step through my code. However, if I put a breakpoint
after the Redirect, execution will not break.

See : http://support.microsoft.com/kb/312629/EN-US

If you use the Response.End, Response.Redirect,
or Server.Transfer method, a ThreadAbortException exception occurs.

The Response.End method ends the page execution and shifts the execution
to the Application_EndRequest event in the application's event pipeline.
The line of code that follows Response.End is not executed.

This problem occurs in the Response.Redirect and Server.Transfer
methods because both methods call Response.End internally.

To work around this problem, use one of the following methods:

1. For Response.End, call the HttpContext.Current.ApplicationInstance.CompleteRe quest
method instead of Response.End to bypass the code execution to the Application_EndRequest event.

2. For Response.Redirect, use an overload, Response.Redirect(String url, bool endResponse)
that passes false for the endResponse parameter to suppress the internal call to Response.End.

For example: Response.Redirect ("nextpage.aspx", false);

That will prevent Response.End from being called internally,
which will allow your code to continue executing.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
<ve****@gmail.comwrote in message news:11**********************@74g2000cwt.googlegro ups.com...
I'm having an issue with an ASP.NET website after upgrading to ASP.NET
2.0. The website makes use of a central authentication service (CAS)
provided at the university I work for. Each page checks a session
variable, and if it is not present, does a Response.Redirect to a
webpage for the CAS passing a url parameter for the url to post back
to. The CAS provides a page for the user to log into, validates the
username and password, and then POSTs encrypted data back to the page I
provided. The information is then decrypted and validated, and if the
user was properly logged in, they are allowed to continue.

The code all seems to run fine. However, the problem I am having is
that after this authentication process I cannot hit breakpoints. That
is, if I place a breakpoint on the page before this Redirect, execution
breaks, and I can step through my code. However, if I put a breakpoint
after the Redirect, execution will not break.

Anyone know how to make my breakpoints function properly with this
off-site redirect?

Thanks,
Eric

Aug 17 '06 #4
I'm running Response.Redirect("nextpage.aspx"); in most cases, although
with find in files I found a Response.Redirect ("nextpage.aspx", true);
in one spot. I don't think it is being hit in the case I was running
before though.

Web.config setting is: <compilation defaultLanguage="c#" debug="true">
Thanks,
Eric

Juan T. Llibre wrote:
Eric,

Are you running

Response.Redirect("nextpage.aspx");
or
Response.Redirect ("nextpage.aspx", false);

?

Also, are you running, in web.config,

<compilation debug="true">
or
<compilation debug="false">

?

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
<ve****@gmail.comwrote in message news:11*********************@i42g2000cwa.googlegro ups.com...
Sorry, I don't think I made the problem very clear. The issue is not
that breakpoints aren't hit in the code directly after the redirect.
The issue is that after redirecting to the CAS site, I can't hit
breakpoints _anywhere_ in my application, ever.

So, for example, lets say the page that CAS posts to has a button on
it, and lets say I put a breakpoint in both the button handler and in
the login page before the redirect to CAS. I will hit the breakpoint
before the redirect, and I can step along through the code until the
redirect. Then, in the browser, the page changes to the CAS login. I
log in, and am directed back to my site on a completely different page.
Now, when I press the button, the button handler executes correctly
(which I verify by having it write something to the database), but
execution does not break at the breakpoint that is placed in the button
handler. When I go into the code now, and look at the breakpoint I
added, it has a warning sign, and says "The breakpoint will not
currently be hit. No symbols have been loaded for this document."

Thanks,
Eric
Juan T. Llibre wrote:
re:
if I place a breakpoint on the page before this Redirect, execution
breaks, and I can step through my code. However, if I put a breakpoint
after the Redirect, execution will not break.
See : http://support.microsoft.com/kb/312629/EN-US

If you use the Response.End, Response.Redirect,
or Server.Transfer method, a ThreadAbortException exception occurs.

The Response.End method ends the page execution and shifts the execution
to the Application_EndRequest event in the application's event pipeline.
The line of code that follows Response.End is not executed.

This problem occurs in the Response.Redirect and Server.Transfer
methods because both methods call Response.End internally.

To work around this problem, use one of the following methods:

1. For Response.End, call the HttpContext.Current.ApplicationInstance.CompleteRe quest
method instead of Response.End to bypass the code execution to the Application_EndRequest event.

2. For Response.Redirect, use an overload, Response.Redirect(String url, bool endResponse)
that passes false for the endResponse parameter to suppress the internal call to Response.End.

For example: Response.Redirect ("nextpage.aspx", false);

That will prevent Response.End from being called internally,
which will allow your code to continue executing.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
<ve****@gmail.comwrote in message news:11**********************@74g2000cwt.googlegro ups.com...
I'm having an issue with an ASP.NET website after upgrading to ASP.NET
2.0. The website makes use of a central authentication service (CAS)
provided at the university I work for. Each page checks a session
variable, and if it is not present, does a Response.Redirect to a
webpage for the CAS passing a url parameter for the url to post back
to. The CAS provides a page for the user to log into, validates the
username and password, and then POSTs encrypted data back to the pageI
provided. The information is then decrypted and validated, and if the
user was properly logged in, they are allowed to continue.
>
The code all seems to run fine. However, the problem I am having is
that after this authentication process I cannot hit breakpoints. That
is, if I place a breakpoint on the page before this Redirect, execution
breaks, and I can step through my code. However, if I put a breakpoint
after the Redirect, execution will not break.
>
Anyone know how to make my breakpoints function properly with this
off-site redirect?
>
Thanks,
Eric
>
Aug 18 '06 #5
re:
The issue is that after redirecting to the CAS site, I can't hit
breakpoints _anywhere_ in my application, ever.
I'm running Response.Redirect("nextpage.aspx"); in most cases, although
with find in files I found a Response.Redirect ("nextpage.aspx", true);
I'd try testing whether you can hit breakpoints
after redirecting to the CAS site, if you use :

Response.Redirect ("nextpage.aspx", false);
in your redirects.

If that doesn't fix the situation and you can repro,
I'd bug the behavior at the Feedback Center:

http://connect.microsoft.com/feedbac...spx?SiteID=210

Notice that the URL for the Feedback Center has changed...

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
"Eric" <ve****@gmail.comwrote in message
news:11**********************@i3g2000cwc.googlegro ups.com...
I'm running Response.Redirect("nextpage.aspx"); in most cases, although
with find in files I found a Response.Redirect ("nextpage.aspx", true);
in one spot. I don't think it is being hit in the case I was running
before though.

Web.config setting is: <compilation defaultLanguage="c#" debug="true">
Thanks,
Eric

Juan T. Llibre wrote:
Eric,

Are you running

Response.Redirect("nextpage.aspx");
or
Response.Redirect ("nextpage.aspx", false);

?

Also, are you running, in web.config,

<compilation debug="true">
or
<compilation debug="false">

?

Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
<ve****@gmail.comwrote in message news:11*********************@i42g2000cwa.googlegro ups.com...
Sorry, I don't think I made the problem very clear. The issue is not
that breakpoints aren't hit in the code directly after the redirect.
The issue is that after redirecting to the CAS site, I can't hit
breakpoints _anywhere_ in my application, ever.

So, for example, lets say the page that CAS posts to has a button on
it, and lets say I put a breakpoint in both the button handler and in
the login page before the redirect to CAS. I will hit the breakpoint
before the redirect, and I can step along through the code until the
redirect. Then, in the browser, the page changes to the CAS login. I
log in, and am directed back to my site on a completely different page.
Now, when I press the button, the button handler executes correctly
(which I verify by having it write something to the database), but
execution does not break at the breakpoint that is placed in the button
handler. When I go into the code now, and look at the breakpoint I
added, it has a warning sign, and says "The breakpoint will not
currently be hit. No symbols have been loaded for this document."

Thanks,
Eric
Juan T. Llibre wrote:
re:
if I place a breakpoint on the page before this Redirect, execution
breaks, and I can step through my code. However, if I put a breakpoint
after the Redirect, execution will not break.
See : http://support.microsoft.com/kb/312629/EN-US

If you use the Response.End, Response.Redirect,
or Server.Transfer method, a ThreadAbortException exception occurs.

The Response.End method ends the page execution and shifts the execution
to the Application_EndRequest event in the application's event pipeline.
The line of code that follows Response.End is not executed.

This problem occurs in the Response.Redirect and Server.Transfer
methods because both methods call Response.End internally.

To work around this problem, use one of the following methods:

1. For Response.End, call the HttpContext.Current.ApplicationInstance.CompleteRe quest
method instead of Response.End to bypass the code execution to the Application_EndRequest event.

2. For Response.Redirect, use an overload, Response.Redirect(String url, bool endResponse)
that passes false for the endResponse parameter to suppress the internal call to Response.End.

For example: Response.Redirect ("nextpage.aspx", false);

That will prevent Response.End from being called internally,
which will allow your code to continue executing.


Juan T. Llibre, asp.net MVP
aspnetfaq.com : http://www.aspnetfaq.com/
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
===================================
<ve****@gmail.comwrote in message news:11**********************@74g2000cwt.googlegro ups.com...
I'm having an issue with an ASP.NET website after upgrading to ASP.NET
2.0. The website makes use of a central authentication service (CAS)
provided at the university I work for. Each page checks a session
variable, and if it is not present, does a Response.Redirect to a
webpage for the CAS passing a url parameter for the url to post back
to. The CAS provides a page for the user to log into, validates the
username and password, and then POSTs encrypted data back to the page I
provided. The information is then decrypted and validated, and if the
user was properly logged in, they are allowed to continue.
>
The code all seems to run fine. However, the problem I am having is
that after this authentication process I cannot hit breakpoints. That
is, if I place a breakpoint on the page before this Redirect, execution
breaks, and I can step through my code. However, if I put a breakpoint
after the Redirect, execution will not break.
>
Anyone know how to make my breakpoints function properly with this
off-site redirect?
>
Thanks,
Eric
>

Aug 18 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Paul | last post by:
I'm not getting the results I want when I use Response.Redirct in a ASP page. I enter this line of code in a asp page from domain1.com. Response.Redirect...
4
by: JC | last post by:
Hi, I have a simple question regarding the Response.Redirect method. Does the server stop processing the ASP code as soon as it encounters the Redirect command? Or does it ever continue to...
4
by: TomT | last post by:
Hi.. I'm redirecting users to another page using: response.redirect("newpage.asp") this works... But I need to add a variable to the page specified.. IE: newpage.asp?id=JobID
6
by: Sam | last post by:
I have some issues with HTTP Headers and I was hoping for some pointers or references to good articles. Here is the problem. I have 6 .aspx pages, each page contains a common .ascx. This ascx...
3
by: Sehboo | last post by:
On my ASP page, when I click a button, I want to do three things: 1. Check for some values. 2. Open a new window and pass some values as query string. 3. Redirect to some other page Here...
13
by: Tim | last post by:
Hello, Is there a way to "cancel" a response.Redirect? For example, in the code below, could I insert anything in the Catch statement that would cancel the redirect and resume flow after the...
9
by: Rea | last post by:
Hi eb I set some 'Stop' statements and also visual breakpoints in asp code (vbscript). I am doing that in Microsoft Script debugger. Than I refresh the original page and expect execution to halt...
4
by: mike.biang | last post by:
I have an ASP page that is using an XMLHTTP object to request various pages from my server. I keep a single session throughout the XMLHTTP requests by bassing the ASPSESSIONID cookie through the...
9
by: RN1 | last post by:
When a server encounters the line Response.Redirect("abcd.asp") in a ASP script, the server tells the browser that it has to be redirected to another page (which is abcd.asp, in this case)....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.