I am using Visual studio 2022. Following is the code. The value (testInput) is not appearing in binding nor is the form breakpoint getting hit in SubmitAnswers method in VS 2022
@page "/Test"<h3>test</h3><form @onsubmit="SubmitAnswers"><input type="text" @bind="testInput" /><button type="submit">Submit</button><br /> value=@testInput</form>@code { private string testInput; private async Task SubmitAnswers() { Console.WriteLine("SubmitAnswers method hit!"); }}When i use
@rendermode InteractiveServer
It binds to the value of text box however the method call (to method SubmitAnswers) is not happening When i try the following it throws the following error
@rendermode InteractiveAuto OR @rendermode InteractiveWebAssembly
error:-
InvalidOperationException: A component of type 'BlazorApp1.Components.Pages.Test' has render mode 'InteractiveAutoRenderMode', but the required endpoints are not mapped on the server. When calling 'MapRazorComponents', add a call to 'AddInteractiveWebAssemblyRenderMode'. For example, 'builder.MapRazorComponents<...>.AddInteractiveWebAssemblyRenderMode()'
How do I fix this ?