what is diffrent bewtten bind-value, bind , value in blazor webAssembly

hamed farjad 40 Reputation points
2023-02-20T17:21:07.89+00:00
@page "/"

<input @bind="someThing" />
<input @bind-value="someThing" />
<input value="someThing" />

@code
{
    string someThing;
}
Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,667 questions
0 comments No comments
{count} votes

Accepted answer
  1. Bruce (SqlWork.com) 73,186 Reputation points
    2023-02-20T19:01:16.62+00:00

    the @bind is used for 2 way binding. to know which property to bind to, you include the -<name>. @bind-Value will bind to the Value property. in the case of input, Value is the default, you you can shorten to @bind

    if a property is set without a @bind, it is one way (set only)

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 73,186 Reputation points
    2023-02-20T19:01:41.18+00:00

    (extra post to display)

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.