Force use of the default content of a master page asp:ContentPlaceholder
-
06-12-2019 - |
Frage
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?
Lösung
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.
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit sharepoint.stackexchange