Skip to main content

The child content element 'ChildContent' of component 'X' uses the same parameter name ('context') ...

When you nest DevExpress Blazor components that contain RenderFragment<TValue> properties, a Razor error can occur. For example, the following code nests a DxButton component within a DxFormLayoutItem component.

<DxFormLayoutItem>
    <Template>
        <DxButton>OK</DxButton>
    </Template>
</DxFormLayoutItem>

Both components include properties that specify render fragments: DxFormLayoutItem‘s Template and DxButton‘s ChildContent. This means that Blazor adds Context implicit parameters to each component:

<DxFormLayoutItem>
    <Template Context="context">
        <DxButton Context="context">OK</DxButton>
    </Template>
</DxFormLayoutItem>

The Context parameters have the same default value. This causes the following error:

Error RZ9999 The child content element ‘ChildContent’ of component ‘DxButton’ uses the same parameter name (‘context’) as enclosing child content element ‘Template’ of component ‘DxFormLayoutItem’. Specify the parameter name like: ‘<ChildContent Context=”another_name”>’ to resolve the ambiguity.

To fix the issue, specify the Context parameter explicitly in one of the components:

<DxFormLayoutItem>
    <Template>
        <DxButton Context="buttonCtx">OK</DxButton>
    </Template>
</DxFormLayoutItem>

Run Demo: Data Grid - Edit Form Template with Validation