Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Should core handle ThreadAbortExceptions from Response.Redirect/Response.End??Should core handle ThreadAbortExceptions from Response.Redirect/Response.End??
Previous
 
Next
New Post
8/15/2008 12:15 PM
 

Hello,

I just ran into an issue with how the core handling ThreadAbortExceptions generated by Response.Redirect or Response.End. Specifically, it has to with exceptions generated from within ActionBase.ProcessAction(). Here is the scenario:

When ProcessAction() is called with ModuleActionType.DeleteModule, it in turn calls ActionBase.Delete(). Delete() ends with call Response.Redirect, which (per http://support.microsoft.com/kb/312629) generates a ThreadAbortException. Now, everywhere ProcessAction is called (e.g. DropDownActions.ascx.vb, LinkActions.acsc.vb, SolPartActions.vb, etc.), it is called withing a Try..Catch clause. This means the ThreadAbortException is handled and discarded, and processing continues.

Where this became an problem was when my code tried to call GetModuleInfo(ModuleId, TabId) after the call to ActionBase.Delete(). In this case, the module had already been deleted, so the call returns Nothing, leading to other errors.

I fixed my code to account for this, but it seemed strange for module's initialization code to be called after it had already been deleted. At the very least, it seems to be a performance issue in that all this code is getting executed for nothing since the page is going to redirect anyway. So here's my questions:

Does anyone think this is a bug? Should the core code avoid handling ThreadAbortExceptions like this? Before I log this in Gemini, I figured I'd look for input here....

Thanks,

-Drew

 

 


Andrew M. Galbraith Ryer

There is nothing like looking, if you want to find something. You certainly usually find something, if you look, but it is not always quite the something you were after.
     -J.R.R. Tolkein
 
New Post
9/5/2008 7:35 PM
 

The solution to this is simple.

Set the endResponse parameter to false for the Response.Redirect method if it is within a Try Catch, then outside the Try Catch do a Response.End

 

 
New Post
9/6/2008 10:35 AM
 

Hi Drew,

You are correct that DNN could use some overall attention in the exception-management arena.  I suggest you proceed in logging this as an enhancement in Gemini -- the core team has been very receptive with other suggestions of this type.

Brandon


Brandon Haynes
BrandonHaynes.org
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0Should core handle ThreadAbortExceptions from Response.Redirect/Response.End??Should core handle ThreadAbortExceptions from Response.Redirect/Response.End??


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out