Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Multiple EditForm in Blazor Page

$
0
0

My Code is :

@if (LoginLevel == 0){<EditForm Model="@SendMobile" OnValidSubmit="Send" FormName="Send"><InputText @bind-Value="SendMobile.Mobile"           placeholder="شمارههمراهخودراواردکنید" class="input"/><button type="submit" class="btn btn-primary icon-left"><i class="fi fi-rs-arrow-left"></i>ادامه</button></EditForm>}else if (LoginLevel==1){<EditForm Model="@SendCode" OnValidSubmit="Authenticate" FormName="Authenticate"><InputText @bind-Value="SendCode.Code"           placeholder="- - - -" class="input text-center" /><ValidationMessage For="() => SendCode.Code" class="text-alert error" /><button type="submit" class="btn btn-primary icon-left mx-1"><i class="fi fi-rs-check"></i>ورود</button></EditForm>@code{public byte LoginLevel { get; set; } = 0;[SupplyParameterFromForm]public Dto.Account.SendMobileDto? SendMobile { get; set; } = new();[SupplyParameterFromForm]public Dto.Account.SendCodeDto? SendCode { get; set; }=new();public async Task Send(){LoginLevel = 1;}}public async Task Authenticate(){}

The Error After Submit Second Form is:

EditForm requires either a Model parameter

Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>