in namespace DotVVM.Framework.Controls

Represents a placeholder in the master page that contains the Content from the content page.

Usage & Scenarios

Represents a placeholder in the master page that contains the Content from the content page.

See Master Pages tutorial for more information.

Sample 1 : Example on Master Page

The ContentPlaceHolder has the ID property which identifies the corresponding Content in the content page.

You can specify a default content for a ContentPlaceHolder. This default content is used when there is no Content with the corresponding ID in the content page. If the Content is present in the content page, it is rendered instead of the the default content.

@viewModel System.Object, mscorlib

<!DOCTYPE html>

<html lang="en" xmlns="">
    <meta charset="utf-8" />

    <h1>My Awesome App</h1>
    <dot:ContentPlaceHolder ID="Menu">
      <!-- This default content can be overridden in the content page. -->
		<li><a href="#">Page 1</a></li>
		<li><a href="#">Page 2</a></li>
		<li><a href="#">Page 3</a></li>
		<li><a href="#">Page 4</a></li>
		<li><a href="#">Page 5</a></li>

    <dot:ContentPlaceHolder ID="Content">
      <!-- Content from page.dothtml with id Main will be placed here. -->

@viewModel DotvvmWeb.Views.Docs.Controls.builtin.Content.sample2.ViewModel, DotvvmWeb
@masterPage master.dotmaster

<dot:Content ContentPlaceHolderID="Content">
	<h3>Welcome! {{value: WelcomeMessage}}</h3>
	<p>Content of the page</p>

<dot:Content ContentPlaceHolderID="Menu">
	<!-- This overrides the default content from the master page. -->
	There is no menu available on this page.
using DotVVM.Framework.ViewModel;

namespace DotvvmWeb.Views.Docs.Controls.builtin.ContentPlaceHolder.sample2
    public class ViewModel : DotvvmViewModelBase
        public string WelcomeMessage { get; set; } = "DotVVM ContentPlaceHolder sample.";


Name Type Description Notes Default Value
property icon RenderWrapperTag Boolean Gets or sets whether the control should render a wrapper element.
inner element
static value
property icon WrapperTagName String Gets or sets the name of the tag that wraps the Repeater.
inner element
static value

HTML produced by the control