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

HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Module Error/Thread Aborted ExceptionModule Error/Thread Aborted Exception
Previous
 
Next
New Post
9/22/2006 12:06 PM
 

After some problems with a previous VS.NET 2003 module project, I have restarted and created a module from scratch (CodeSmith, etc.)

My module successfully adds records to the database, but, for some reason, it does not work when I navigate to an existing record in the edit screen and try to update/change a record via the Update function and stored proc. It doesn't blow up, it shows no error in the log viewer...but when I carefully watch it in my debugger, I notice that right at the end it says "thread being aborted" in the try/catch block.

private void cmdUpdate_Click(object sender, EventArgs e)

{
try{
if (Page.IsValid == true)
{

MultiSectionInfo objMultiSectionInfo = new MultiSectionInfo();
objMultiSectionInfo = ((MultiSectionInfo)CBO.InitializeObject(objMultiSectionInfo,
typeof(MultiSectionInfo)));
objMultiSectionInfo.ItemId = itemId;
objMultiSectionInfo.PortalId = PortalId;
objMultiSectionInfo.ModuleId = ModuleId;
objMultiSectionInfo.LinkTitle = LinkTitle.Text;
objMultiSectionInfo.SectionTitle = SectionTitle.Text;
MultiSectionController objCtlMultiSection = new MultiSectionController();

if (itemId == -1 || Null.IsNull(itemId))
{
objMultiSectionInfo.CreatedDate = DateTime.Now;
objCtlMultiSection.Add(objMultiSectionInfo);
}

else
{
objMultiSectionInfo.CreatedDate = DateTime.Now;
objCtlMultiSection.Update(objMultiSectionInfo);
}

//try{  THIS TRY/CATCH WAS AN ATTEMPT TO FIX/FIND THE REAL PROBLEM

Response.Redirect(Globals.NavigateURL(), true);

//}catch (ThreadAbortException ex){Thread.ResetAbort();}

}

}

catch (Exception exc)
{
Exceptions.ProcessModuleLoadException(
this, exc);
}

}

 
New Post
10/4/2006 10:35 AM
 

I'm having the same issue.  It seems to me to be related to a known Microsoft issue with Response.Redirect.  Microsoft recommends using Response.Redirect(url, false) then calling HttpContext.Current.ApplicationInstance.CompleteRequest(). That doesn't seems to fix the issue either.

I need to load multiple controls within the same module and navigate between them.  Even writing out a hyperlink that the user must click is still generating this threadabortexception.

Kgarl, if you figure this out, I'd appreciate you posting the answer.

Aaron

 
New Post
10/4/2006 1:24 PM
 

Change

Response.Redirect(Globals.NavigateURL(), true);

to

Response.Redirect(Globals.NavigateURL(), false);

so DotNetNuke can finish it's processing.  Your code is having a control on the page try to end the current thread immediately, and DotNetNuke needs to finish and clean up first.  Use the later to avoid the ThreadAbortException.

Aaron

 
Previous
 
Next
HomeHomeOur CommunityOur CommunityGeneral Discuss...General Discuss...Module Error/Thread Aborted ExceptionModule Error/Thread Aborted Exception


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