We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

ChildContent Context = another_name Ambiguity

I'm trying to implement CustomAuthenticationStateProvider. When Implementing AuthorizedView and Authorized I get this Error:  

Error (active) RZ9999 The child content element 'ChildContent' of component 'EditForm' uses the same parameter name ('context') as enclosing child content element 'Authorized' of component 'AuthorizeView'. Specify the parameter name like: '<ChildContent Context="another_name"> to resolve the ambiguity D:\Blazor Projects\EMRDispatch\EMRDispatch\Pages\Index.razor
I can't figure out how to resolve this.
My Edit form is inside a sfDialog:

 @*=====================Add Edit GL Dialog =========================*@
        <div class="container">
            <SfDialog @ref="DialogAddEditUserStaffingStatus" IsModal="true" Width="350px" ShowCloseIcon="true" Visible="false">
                <DialogTemplates>
                    <Header>@HeaderText</Header>
                </DialogTemplates>
                <DialogAnimationSettings Effect="@AnimationEffect" Duration=400 />
                <EditForm Model="@AddEditUserStaffingStatus" OnValidSubmit="@UserAddEditSave">
                    <DataAnnotationsValidator />
                    <div style="padding:10px">
                        <SfTextBox Enabled="true" Placeholder="EMR Name"
                                   FloatLabelType="@FloatLabelType.Always"
                                   @bind-Value="AddEditUserStaffingStatus.FullName"
                                   Readonly=true></SfTextBox>


                        <SfDropDownList DataSource="@staffing"
                                        TItem="StaffingModel"
                                        TValue="int"
                                        Text="StaffingID"
                                        @bind-Value="AddEditUserStaffingStatus.StaffingID"
                                        FloatLabelType="@FloatLabelType.Always"
                                        Placeholder="Select Staffing"
                                        Width="150px">
                            <ValidationMessage style="font-size:0.7rem;" For="@(() => AddEditUserStaffingStatus.StaffingID)" />
                            <DropDownListFieldSettings Text="Staffing" Value="StaffingID"></DropDownListFieldSettings>
                            <DropDownListEvents TItem="StaffingModel" TValue="int" ValueChange="OnChangeStaffing"></DropDownListEvents>
                        </SfDropDownList>
                        <SfDropDownList DataSource="@status"
                                        TItem="StatusModel"
                                        TValue="int"
                                        Text="StatusID"
                                        @bind-Value="AddEditUserStaffingStatus.StatusID"
                                        FloatLabelType="@FloatLabelType.Always"
                                        Placeholder="Select Status"
                                        Width="150px">
                            <ValidationMessage style="font-size:0.7rem;" For="@(() => AddEditUserStaffingStatus.StatusID)" />
                            <DropDownListFieldSettings Text="Status" Value="StatusID"></DropDownListFieldSettings>
                            <DropDownListEvents TItem="StatusModel" TValue="int" ValueChange="OnChangeStatus"></DropDownListEvents>
                        </SfDropDownList>
                    </div>


                    <br />
                    <div class="e-footer-content">
                        <div class="button-container">
                            <button type="submit" class="e-btn e-normal e-primary" style="width:100px" disabled=@isSubmitting>Save</button>
                            <button type="button" class="e-btn e-normal e-danger" @onclick="@CloseDialogAddEdit" style="width:100px">Cancel</button>
                        </div>
                    </div>
                </EditForm>
            </SfDialog>
        </div>


Any Help is highly appreciated


"


4 Replies 1 reply marked as answer

OT oliver tejada February 24, 2023 04:53 AM UTC

Attached is my code below.


Attachment: code_133a4e96.7z


VJ Vinitha Jeyakumar Syncfusion Team February 24, 2023 01:47 PM UTC

Hi oliver,

We want to let you know that the reported issue occurs when we try to put an EditForm in an Authorize view and it is not because of the SfDialog Component. And the issue occurs because of the AuthorizeView and EditForm both use the same Context variable.
To avoid this you can change the variable name on them like below,


Code snippet:
<AuthorizeView Context="authContext">
    <Authorized>
        <EditForm Context="formContext">
            ...
        </EditForm>
    </Authorized>
</AuthorizeView>


Please refer to the below link for further reference,

Regards,
Vinitha

Marked as answer

OT oliver tejada February 26, 2023 06:34 PM UTC

Thank you very much. I was surprised it was a simple fix. 



VJ Vinitha Jeyakumar Syncfusion Team February 27, 2023 04:58 AM UTC

Hi oliver,


We are glad to assist you.

Regards,
Vinitha

Loader.
Up arrow icon