1
Vote

HttpException On Theme Selection

description

Selecting a theme and pressing the back button and selecting a new theme causes an HttpException. (You may have to perform this multiple times)
 
Steps to recreate:
  1. Login as an admin user.
  2. Go to Administration ==> CMS Setup
  3. Select a new theme at the bottom of the page.
  4. Press the back button in the browser.
  5. From here select a new theme. (If page does not crash select go back to step 3)

comments

MrMonopoly wrote Feb 26, 2009 at 12:23 AM

We have found a fix for this bug. You can add a try catch around the piece of code throwing the Exception and log the specific Exception using the Log class. You can do this by adding in the following code in TemplateContent.cs. The attached file is a screen shot of where to add the fix. Replace the highlighted line with the following code.

protected override void CreateChildControls()
    {

        if (_template != null)
        {
            try
            {
                PlaceHolder ctl = new PlaceHolder();
                _template.InstantiateIn(ctl);
                Controls.Add(ctl);
            }
            catch (HttpException ex) {
                Log newLog = new Log();
                newLog.AddLogEntry(HttpContext.Current.Request, ex);
            }
        }
    }
You will also have to add the following "using" statement to the TemplateControl.cs file: "using System.Web.SessionState;".