473,695 Members | 2,820 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HttpContext.Cur rent.Response.R edirect

Hi there

I have a program written by another company (it's a "web control" which
returns a web-page: can I compare this to a servlet in the Java world?),
which they think is causing problems on their server.

But no-one really knows if this program is at fault because the problem only
exhibits itself every once and a while, and the only thing they can see is
that their web-users suddenly stop receiving responses.

Anyway, at some points in this program it does this:
HttpContext.Cur rent.Response.R edirect(redirec t);
where redirect is a string which has the value "/style.css".

This causes an exception like:
Exception: System.Threadin g.ThreadAbortEx ception
Message: Tråden var ved at blive afbrudt. (the thread was about to be
interrupted?)
Source: mscorlib
at System.Threadin g.Thread.AbortI nternal()
at System.Threadin g.Thread.Abort( Object stateInfo)
at System.Web.Http Response.End()
at System.Web.Http Response.Redire ct(String url, Boolean endResponse)
at System.Web.Http Response.Redire ct(String url)
at InfoWeb.Net.Fet chHandler.Handl e(HttpRequest request, HtmlTextWriter
output)
at InfoWeb.Net.Inf oWebControl.Ren der(HtmlTextWri ter output)

What does it mean to redirect to a "css"? And what does the exception mean?
I don't really know if this is a part of the bigger problem because the
program continues quite happily afterwards - servicing requests.

Thanks,
Peter


Nov 17 '05 #1
1 15310
Peter Kirk wrote:
Hi there

I have a program written by another company (it's a "web control"
which returns a web-page: can I compare this to a servlet in the Java
world?), which they think is causing problems on their server.

But no-one really knows if this program is at fault because the
problem only exhibits itself every once and a while, and the only
thing they can see is that their web-users suddenly stop receiving
responses.
Anyway, at some points in this program it does this:
HttpContext.Cur rent.Response.R edirect(redirec t);
where redirect is a string which has the value "/style.css".

This causes an exception like:
Exception: System.Threadin g.ThreadAbortEx ception
Message: Tråden var ved at blive afbrudt. (the thread was about to be
interrupted?)
Source: mscorlib
at System.Threadin g.Thread.AbortI nternal()
at System.Threadin g.Thread.Abort( Object stateInfo)
at System.Web.Http Response.End()
at System.Web.Http Response.Redire ct(String url, Boolean endResponse)
at System.Web.Http Response.Redire ct(String url)
at InfoWeb.Net.Fet chHandler.Handl e(HttpRequest request,
HtmlTextWriter output)
at InfoWeb.Net.Inf oWebControl.Ren der(HtmlTextWri ter output)

What does it mean to redirect to a "css"? And what does the exception
mean? I don't really know if this is a part of the bigger problem
because the program continues quite happily afterwards - servicing
requests.
Thanks,
Peter


This exception will occur if that redirect is done from within a try/catch.
This is expected behaviour. You can ignore it or (better) have that other
company move the redirect out of the try/catch.

A redirect to a css looks odd, but is not impossible. The question is
*why* does it do that redirect.

By the way: a better place to post aspnet related questions is in the
microsoft.publi c.dotnet.framew ork.aspnet group.

Hans Kesting
Nov 17 '05 #2

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

Similar topics

7
2740
by: Keith Patrick | last post by:
After completely giving up on finding some way in my ASP.Net app to take a query string URL and redirect to it as a POST instead, I went with a system like so: Upon "redirection," all the QueryString pairs are placed in HttpContext.Current.Items and retrieved with a wrapper for Request.Params that includes checks there. This works in general instances, but one problem has come up that has me stuck: since the stuff is in the context and...
2
2141
by: | last post by:
Today I learned that creating cookies inside of a custom class in ASP.NET 2.0 requires that you prefix it with HttpContext.Current..., e.g. : HttpContext.Current.Response.Cookies.Add("myNewCookie"); I am wondering if there are any landmines that I should know about, or if this will work pretty much as I am expecting a cookie should.
3
2936
by: asanford | last post by:
I want to create an ASP.NET web application that receives a form POST message, inspects the data, and reroutes the request to one of many different servers. I wrote an IHttpModule which successfully used HttpContext.RewritePath() to send a request to different pages in one web application, but it gives me an error when I try to rewrite a path to a different web app or server. Does RewritePath() not support this? I can reroute by...
7
4252
by: Hardy Wang | last post by:
Hi, I have a web application, code of ASPX page needs to call one static method in another class which does not inherit System.UI.Page class using System.Web; public class Utils { public static void GetSessions() { HttpContext ctx = HttpContext.Current; ctx.Session; // not available. <undefined value>
1
1299
by: Torfi | last post by:
Hello all I've got a very weird situation I need help with. I'm building a solution where I have custom components in a web content management system using a web store library (API in DLLs). The CMS is using Forms authentication to verify users when they log in. I log the user in using the following code: private bool AttemptLogon( string username, string password ) {
0
5393
by: Aaron Morton | last post by:
I'm working on a IHttpModule that handles the PreSendRequestHeaders event from the HttpApplication, if the event is raised after EndRequest then HttpContext.Current is null. If it is raised before EndRequest (by turning response buffering off) then HttpContext.Current is set. To repo add the following to Global.asax protected void Application_PreSendRequestHeaders(object sender, EventArgs e) {...
2
4623
by: Doogie | last post by:
What is the difference between this: HttpContext.Current.Response and this: System.Web.HttpApplication.Response I want to create a common method in a .vb file and cannot use System.Web.HttpApplication.Response to do it. But I can use
2
3112
by: =?Utf-8?B?YWxiZXJ0b3Nvcmlh?= | last post by:
Hi, I'm using Threads, and when I try to do Server.Transfer, I recieved an error. (child object does not exist...) My Code: Dim t As New Thread(AddressOf Hilo) Private Sub Hilo() Thread.Sleep(1000)
0
2274
by: alister7 | last post by:
hi every1 im trying to download a music file from the database SQLserver.which i upload in the database.. The Code below works fine in wen i create a new project of an ASP.Net web application..m using VS 2008 but it gives me an error wen i run the same code in WPF broser APplication(xbap).. it throws an error saying Null reference encountered. the line of error is HTTPcontext context=HTTPcontext.Current; it goes in the else part of the...
0
8568
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9115
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. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8982
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8845
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 most users, this new feature is actually very convenient. If you want to control the update process,...
0
7660
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 launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4340
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4579
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2272
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1976
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 effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.