Knowledge Base

CMS 10.6: DSS Page Rendering Conflicts Occur If View Corresponds with Multiple Custom Controllers

In CMS 10.6, some pages may render incorrectly on the DSS when the corresponding views associate with multiple custom controllers and are not routed through them. In these scenarios, the page content may display as expanded XML without view formatting.


Known Issue Statement

In CMS 10.6, site pages may not render as expected on the DSS when the DSS imeplementation includes more than one custom controller override and the corresponding views are not routed through these custom controllers. For example, this rendering issue may take place when one custom controller is set as the CMSPageDefaultController while another controller is not.

Symptoms

After a DSS application pool recycle, the first page the user opens on the DSS may display as expanded XML without a view. This issue generally occurs when the view used to render the page content corresponds with a second custom controller.

Resolution

An upcoming CMS release will resolve this issue.

Workaround

As a CMS 10.6 workaround, add the RenderingContextOverride.cs class file to the DSS solution and modify the CMS page default conroller's viewOrXsltFallback code. After you make these changes, rebuild the DSS solution and recycle the DSS application pool.

  1. Add RenderingContextOverride.cs to DSS Solution
  2. Modify CMSPageDefaultController.cs
  3. Rebuild DSS Solution and Recycle DSS Application Pool

Add RenderingContextOverride.cs to DSS Solution

To add the RenderingContextOverride.cs class to the DSS solution:

  1. Download RenderingContextOverride.zip to your server file system and extract the contents.
  2. Navigate to your DSS site's root folder.
  3. Open the DSS solution, Dynamic_Site_Server_Instance.sln, in Visual Studio, then expand the solution in the Solution Explorer.
  4. Right-click the Models folder, then select Add > Existing Item.
  5. Browser for and select RenderingContextOverride.cs, then click Add.

    Visual Studios adds the class file to the Models folder.

Keep the DSS solution open in Visual Studio to modify the CMSPageDefaultController.cs file.

Modify CMSPageDefaultController.cs

To modify the viewOrXsltFallback code in CMSPageDefaultController.cs:

  1. Expand the Controllers folder in the Visual Studio Solution Explorer, then open the CMSPageDefaultController.cs file.
  2. Navigate to internal virtual ActionResult viewOrXsltFallback(CMSPageRequest pageRequest) within the file, then select the code.

    The code will look similar to the following:

    Original viewOrXsltFallback code
    internal virtual ActionResult viewOrXsltFallback(CMSPageRequest pageRequest)
    {
        CMSPageRenderingEngine renderEngine = pageRequest.IsPreview ?
            new PreviewPageRenderingEngine(this,
                (pageRequest as CMSPageDocumentDynamicPreviewRequest).ContentStore,
                (pageRequest as CMSPageDocumentDynamicPreviewRequest).CurrentUser,
                _SitePath, _DTSitePath, _UseTempStylesheetsLocation,
                _LegacyTransformation) :
            new CMSPageRenderingEngine(
            this, _SitePath, _DTSitePath, _UseTempStylesheetsLocation, _LegacyTransformation);
    
        HttpContext.Items["PageRequest"] = pageRequest;
    
        CMSPageRequest model = pageRequest;
        if (pageRequest is ContentUnitPreviewRequest)
        {
            model = (pageRequest as ContentUnitPreviewRequest).Root as CMSPageRequest;
            model.Tag = "CUPreview";
        }
    
        return renderEngine.Render(model);
    }
  3. Replace the existing internal virtual ActionResult viewOrXsltFallback(CMSPageRequest pageRequest) code within the file by copying pasting the following code:
    Updated viewOrXsltFallback code
    internal virtual ActionResult viewOrXsltFallback(CMSPageRequest pageRequest)
    {
        if (pageRequest.IsPreview)
        {
            var renderingEngine = new PreviewRenderingContextOverride(this,
                (pageRequest as CMSPageDocumentDynamicPreviewRequest).ContentStore,
                (pageRequest as CMSPageDocumentDynamicPreviewRequest).CurrentUser,
                _SitePath, _DTSitePath, _UseTempStylesheetsLocation,
                _LegacyTransformation);
    
            HttpContext.Items["PageRequest"] = pageRequest;
    
            CMSPageRequest model = pageRequest;
            if (pageRequest is ContentUnitPreviewRequest)
            {
                 model = (pageRequest as ContentUnitPreviewRequest).Root as CMSPageRequest;
                 model.Tag = "CUPreview";
            }
    
            return renderingEngine.Render(model);
         }
         else
         {
            var renderingEngine = new RenderingContextOverride(
                 this, _SitePath, _DTSitePath, _UseTempStylesheetsLocation, _LegacyTransformation);
    
            HttpContext.Items["PageRequest"] = pageRequest;
    
            CMSPageRequest model = pageRequest;
            if (pageRequest is ContentUnitPreviewRequest)
            {
                 model = (pageRequest as ContentUnitPreviewRequest).Root as CMSPageRequest;
                 model.Tag = "CUPreview";
            }
    
            return renderingEngine.Render(model);
         }
    }
  4. Save and close CMSPageDefaultController.cs.

Rebuild DSS Solution and Recycle DSS Application Pool

  1. To rebuild the DSS solution, right-click the solution in the Visual Studio Solution Explorer and select Rebuild.
  2. To recycle the DSS application pool, navigate to the application pool in the Internet Information Services (IIS) Manager, then right-click the application pool and select Recycle.

Additional Information

If you have questions or encounter further issues, contact Ingeniux Support.

  • PRODUCT: CMS
  • VERSION: CMS 10
  • RELEASE: 10.6
  • Published: April 21, 2025
  • LAST UPDATED: April 28, 2025
  • Comments: 0

Please login to comment

Comments


There are no comments yet.