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
"
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,
<AuthorizeView Context="authContext"> <Authorized> <EditForm Context="formContext"> ... </EditForm> </Authorized> </AuthorizeView> |
Thank you very much. I was surprised it was a simple fix.