Response.Redirect Thread Was Being Aborted. Properly Handle this Exception and not with a Try/Catch.

 

Due to Response.End calls Thread.Abort.

To avoid this error you can catch for it like most people do it.

Or do it the “right” way.

Don’t call Response.End by using the overload.  Use HttpApplication.CompleteRequest() instead.

Response.Redirect(stringURL, False)
HttpContext.Current.ApplicationInstance.CompleteRequest()

Unfortunately, since you’re not aborting the thread the postback finishes and the html gets sent to the client.

Found a great post on the topic here by John S. Reid, where he goes into details on the solution.  For now, here’s the final solution. I would suggest a base page. But this is what you would have on your actual page.

 

Private blnPageIsTerminating As Boolean = False

Protected Sub SomePageEventOrOtherMethodThatYouAreRedirectingFrom()
    Response.Redirect(UrlDocumentLink(oCurrDocument.DocumentMasterID), False)
    HttpContext.Current.ApplicationInstance.CompleteRequest()
    blnPageIsTerminating = True
End Sub

Protected Overrides Sub RaisePostBackEvent(ByVal sourceControl _
           As IPostBackEventHandler, ByVal eventArgument As String)
    If blnPageIsTerminating = False Then
        MyBase.RaisePostBackEvent(sourceControl, eventArgument)
    End If
End Sub

Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
    If blnPageIsTerminating = False Then
        MyBase.Render(writer)
    End If
End Sub

Free MVC3 Training via Virtual Conference

Awesome find by my friend Pasha.

http://www.mvcconf.com/

Free/Donation virtual conference on ASP.NET MVC3.

Some of the speakers:

Scott Guthrie – Microsoft
Scott Hanselman – Microsoft
Phil Haack – Microsoft

and more…

 

Some of the Sessions:

Intro to Building Twilio Apps with ASP.NET MVC
To the Next Level of Customizability with ASP.NET MVC Dynamic Filters
MVC Q&A
Introduction to MVC 3
The Big Comparison of ASP.NET MVC View Engines
Real World Application Development with Mvc3 NHibernate, FluentNHibernate and Castle Windsor
Mvc3 Extensibility

and more…

From the site:

MvcConf is a virtual conference focused on one thing: writing awesome applications on top of the ASP.Net MVC framework. Your brain will explode from taking in so much hard core technical sessions. Sounds fun eh?

This is a community event and we want the best and brightest sharing what they know.

We intend to record each session and make them available online for viewing. We intend to make the videos available free of charge, depending on conference sponsorships.

Disabling ASP.NET Validators via Client Side Javascript

I had the need to disable my asp.net expression validator when some other client side events fired a post back.

 

Here’s the snippet if you need it.

function specialClientSideToDo()
{
  var reValidator= document.getElementById('<%=reValidator.ClientID%>');
  ValidatorEnablereValidator, false); 
}

 

Later I re-enable after I’m done doing whatever I had to do.

Slow Remote Desktop

These are the commands I ran to speed up Remote Desktop. Article is for Vista, but it applies to Windows 7 as well.  Run commands locally even if it’s just a particular server that is slow. Which makes you think it’s that server and not your machine.

Not sure if it applies to XP.

- Run a command prompt (cmd.exe) as an Administrator
- Type: netsh interface tcp set global autotuninglevel=disabled
Disable the autotunning feature in Vista completely, and fit and lock the RWIN receive window to default value 65536 bytes.
If you want to to re-enable it:
- Type: netsh interface tcp set global autotuninglevel=normal
In some cases you may need to use this command in addition to the above, but I didn't have to:
- Type: netsh interface tcp set global rss=disabled
Update! This command makes your network connection EVEN FASTER
Type: netsh interface tcp set global autotuninglevel=highlyrestricted
The reason is that this command will still "auto tune" your TCP connections, but not as drastically as 'normal' mode. It will allow the receive window to grow beyond the default value, but again it will do so very conservatively.

Source: http://blog.tmcnet.com/blog/tom-keating/microsoft/remote-desktop-slow-problem-solved.asp