Partial page content when ajax #7953

ziic opened this Issue Jan 26, 2018 · 2 comments


None yet
3 participants

ziic commented Jan 26, 2018

When request a page (home, for example) with ajax (with http header X-Requested-With: XMLHttpRequest) then I get only partial content of zone "Content". Without wrapped content of Document.cshml and Layout.cshtml

Why? How can I disable such behaviour?

It is reproduced on new clear site (v1.10.1, v1.10.2). "Core" recipe. Disable all modules except "Alias", "Feed", "Containers".

By the way: Feeds and Containers modules for some reason cannot be disabled. When I click "disable" I get nothing.


carlwoodhouse commented Feb 1, 2018

this is by design (mostly because its unusual to not want just the content via ajax)

Look at Orchard.Core.Contents.Controllers.ItemController int he display method

   var model = _contentManager.BuildDisplay(contentItem);
   if (_hca.Current().Request.IsAjaxRequest()) {
      return new ShapePartialResult(this,model);

You could probably replicate this controller action in your own module and not put that part in ;) or similar


sebastienros commented Feb 1, 2018

Maybe we could handle a special case with a custom header to keep the theme, that's not really hard to do and not breaking either. Not security issue too I assume.

@sebastienros sebastienros added this to the Orchard 1.10.x milestone Feb 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment