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

Blazor c# following value (testInput) is not appearing in binding nor is the form breakpoint getting hit in SubmitAnswers method in VS 2022

$
0
0

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 ?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



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