I have a website where one specific block of ASP.NET/HTML code renders only when I am signed into the website. This happens across all browsers.

I need the 'caption_homebanner' div to render for anonymous users as well. What interaction is there between ASP.NET code and permissions? This is so odd -never have seen anything like this.

This is the code:

<div class="caption_homebanner">
                <div data-name="Page Field: Page Content">
                    <!--CS: Start Page Field: Page Content Snippet-->
                    <!--SPM:<%@Register Tagprefix="PageFieldRichHtmlField" Namespace="Microsoft.SharePoint.Publishing.WebControls" Assembly="Microsoft.SharePoint.Publishing, Version=, Culture=neutral, PublicKeyToken=71e9bce111e9429c"%>-->
                    <!--MS:<PageFieldRichHtmlField:RichHtmlField FieldName="f55c4d88-1f2e-4ad9-aaa8-819af4ee7ee8" runat="server">-->
                        <!--PS: Start of READ-ONLY PREVIEW (do not modify)--><div id="ctl02_label" style="display:none">Page Content</div><div id="ctl02__ControlWrapper_RichHtmlField" class="ms-rtestate-field" style="display:inline" aria-labelledby="ctl02_label"><div align="left" class="ms-formfieldcontainer"><div class="ms-formfieldlabelcontainer" nowrap="nowrap"><span class="ms-formfieldlabel" nowrap="nowrap">Page Content</span></div><div class="ms-formfieldvaluecontainer"><div class="ms-rtestate-field"></div></div></div></div><!--PE: End of READ-ONLY PREVIEW-->
                    <!--CE: End Page Field: Page Content Snippet-->

View when signed in (authorized) enter image description here

View when not signed in (anonymous access)

View when not signed in (Anonymous Access)

  • Is this an Office 365/SP2013 Public site? Or on-prem? – z.rahui Jul 24 '14 at 0:28
  • This is SP Server Public Site – Mia Jul 24 '14 at 19:26

It seems that the content is retrieved dynamically via CSOM or REST, in that case it could explain why it happens.

The access to CSOM/REST in anonymous context is not allowed in SharePoint 2013 by default, please follow What Every Developer Needs to Know About SharePoint Apps, CSOM, and Anonymous Publishing Sites article for an explanation and the solution how to enable CSOM/REST in Anonymous context.


What Every Developer Needs to Know About SharePoint Apps, CSOM, and Anonymous Publishing Sites

  • Thank you Vadim! Yes for the most part SP content is by default dynamic because it's based on ASP.NET The feature which doesn't appear in anonymous context is not based on CSOM/Rest as far as I know. (I am not as familiar with these and need to learn) The blue box caption element is a Rich Html Page Field control. These exist in other places on this same page and with almost identical code and have no problem showing on anonymous access. Any other idea? I will pursue your suggestion deeper though thank you. – Mia Jul 24 '14 at 19:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.