473,545 Members | 666 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Breakpoints after Response.Redire ct 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.Redire ct 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 4547
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.Redire ct,
or Server.Transfer method, a ThreadAbortExce ption exception occurs.

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

This problem occurs in the Response.Redire ct 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.Cur rent.Applicatio nInstance.Compl eteRequest
method instead of Response.End to bypass the code execution to the Application_End Request event.

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

For example: Response.Redire ct ("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.c omwrote in message news:11******** **************@ 74g2000cwt.goog legroups.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.Redire ct 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.Redire ct,
or Server.Transfer method, a ThreadAbortExce ption exception occurs.

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

This problem occurs in the Response.Redire ct 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.Cur rent.Applicatio nInstance.Compl eteRequest
method instead of Response.End to bypass the code execution to the Application_End Request event.

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

For example: Response.Redire ct ("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.c omwrote in message news:11******** **************@ 74g2000cwt.goog legroups.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.Redire ct 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.Redire ct("nextpage.as px");
or
Response.Redire ct ("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.c omwrote in message news:11******** *************@i 42g2000cwa.goog legroups.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.Redire ct,
or Server.Transfer method, a ThreadAbortExce ption exception occurs.

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

This problem occurs in the Response.Redire ct 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.Cur rent.Applicatio nInstance.Compl eteRequest
method instead of Response.End to bypass the code execution to the Application_End Request event.

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

For example: Response.Redire ct ("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.c omwrote in message news:11******** **************@ 74g2000cwt.goog legroups.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.Redire ct 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.Redire ct("nextpage.as px"); in most cases, although
with find in files I found a Response.Redire ct ("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.Redire ct("nextpage.as px");
or
Response.Redire ct ("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.c omwrote in message news:11******** *************@i 42g2000cwa.goog legroups.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.Redire ct,
or Server.Transfer method, a ThreadAbortExce ption exception occurs.

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

This problem occurs in the Response.Redire ct 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.Cur rent.Applicatio nInstance.Compl eteRequest
method instead of Response.End to bypass the code execution to the Application_End Request event.

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

For example: Response.Redire ct ("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.c omwrote in message news:11******** **************@ 74g2000cwt.goog legroups.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.Redire ct 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.Redire ct("nextpage.as px"); in most cases, although
with find in files I found a Response.Redire ct ("nextpage.aspx ", true);
I'd try testing whether you can hit breakpoints
after redirecting to the CAS site, if you use :

Response.Redire ct ("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.c omwrote in message
news:11******** **************@ i3g2000cwc.goog legroups.com...
I'm running Response.Redire ct("nextpage.as px"); in most cases, although
with find in files I found a Response.Redire ct ("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.Redire ct("nextpage.as px");
or
Response.Redire ct ("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.c omwrote in message news:11******** *************@i 42g2000cwa.goog legroups.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.Redire ct,
or Server.Transfer method, a ThreadAbortExce ption exception occurs.

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

This problem occurs in the Response.Redire ct 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.Cur rent.Applicatio nInstance.Compl eteRequest
method instead of Response.End to bypass the code execution to the Application_End Request event.

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

For example: Response.Redire ct ("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.c omwrote in message news:11******** **************@ 74g2000cwt.goog legroups.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.Redire ct 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
3887
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 "http://www.domain2.com/VDIR2/table.asp" & "?PubID=" & PubID & "&PubName=" & PubName The query string is data to open a DB. the page displays
4
3041
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 process the page? Basically, with the following code: Response.Redirect("../newpage.asp")
4
14599
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
4303
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 serves two purposes, 1. it contains a tab strip with response.redirects to navigate to the other pages; 2. I authenticate the user by check to see if...
3
818
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 is the code: If (sServiceCenter = "*ALL") Then sServiceCenter = "%"
13
4672
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 try-catch? Try Response.Redirect(strPage) Catch ex1 As Threading.ThreadAbortException ex1 = ex1 'Cancel Respone here
9
4895
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 at these breakpoints but unfortunatly it does not.. I had allowed script debugging in both iis home directory and in internet explorer. Also i...
4
11405
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 XMLHTTP object. However, when the page requested through the XML object makes a <%Response.Redirect()%> call, a new session is created each...
9
4332
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). The browser then makes a new request to the server to redirect itself to abcd.asp after which the user gets redirected to abcd.asp. But in case of...
0
7467
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7656
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7419
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7756
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5971
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5326
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
1
1879
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1014
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
703
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.