If I told you that "You require sunglasses or an umbrella but not both." you would have no idea if it is raining or not. When running my Blazor web application I get
EditForm requires a Model parameter, or an EditContext parameter, but not both
My code has:
<EditForm Model="@order" OnSubmit="OnSubmit">
so as far as I know I am only using a Model parameter. I think use of the word 'Or' in error messages should be banned. My guess is that something has auto generated EditContext. Has anybody got any idea where to look?
Did you create an instance for the variable @order? You will get this error message if you defined @order but leave it null.
If that's the case, it relates to the admittedly awkward error message because "EditForm requires a Model parameter, or an EditContext parameter", but you provided neither.
See: ASP.NET Core Blazor forms and validation : Troubleshoot
When assigning a Model to the form, confirm that the model type is instantiated
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With