Question

I have a ContentPlaceholder in my custom master that has default content. I want to always use this default content. However there are some pages in the 14 hive that have an asp:Content that superceeds the default content. Is there a way to prevent this and if so, how?

Était-ce utile?

La solution

There isn't a way to prevent the ContentPlaceHolder from being 'overriden'. If you have control over the html of the masterpage, you could can:

  • Move the defaults contents outside the content placeholder (if you are sure that the content should always be present on the page). Then put a <div style="display:none">..</div> around the placeholder.
  • Do the above but put the default contents into a new placeholder with a new unique name.
  • Alter the application pages / page layouts that are implementing the placeholder.

  • Do something clever through the object model.

Licencié sous: CC-BY-SA avec attribution
Non affilié à sharepoint.stackexchange
scroll top