Closed endeffects closed 5 years ago
@jbomhold3 I think thats a "problem" in the way Blazor does cascading values... I put the word problem is quotes because I doubt they will fix it.
Should we just go and prefix all our cascading values with "BS"?
After playing around with this some. This is not a blazorstrap issue. It happens with the default EditForm. This can be fixed easily
<Authorized context="Auth"> @Auth.User..... </Authorized>
Checking into the matter more this is Blazors Default behavior when dealing with a RenderFragment
Based on the information @jbomhold3 found out about Cascading Values with RenderFragment, we are closing this issue
Ah thank you, i did not noticed this and i found nothing related to the error code.
One more question about the context issue, won't it make sense to use a custom context name within the BlazorStrap RenderFragments by default? The chance that this happens for other users seems to be high and you could prevent this easily?
We can't we don't use the name "context" at all - when we use RenderFragment
Oh ok, I just thought you are able to override it on a lower level as suggested.
Yes that’s what I thought too when I first read the issue but after more investigation by John we found that is not the case. Sadly.
RenderFragment
After playing around with this some. This is not a blazorstrap issue. It happens with the default EditForm. This can be fixed easily
<Authorized Context="Auth"> @Auth.User..... </Authorized>
Btw, the attribute Context is case-sensitive, so a lower-case 'c' won't work when adding the context name. You must spell the word Context with an upper-case 'C'.
just for the correct overall answer: <Authorized Context="Auth"> @Auth.User..... </Authorized>
@Manzoliz 's answer is by far the most accurate.
I have surrounded some of my controls with an AuthorizeView. With the latest version of BlazorStrap i receiving the following error:
Error RZ9999 The child content element 'ChildContent' of component 'BSForm' 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