Reputation: 2816
While implementing custom form in Blazor I am not able to bind value to html input box.
<div class="col-sm-4">
<input type="text" class="form-control" id="title" placeholder="Blog Title"
@bind-Value="blogTitle" @bind-value:event="oninput" />
</div>
@code
{
string blogTitle = "";
}
I am using Blazor version 3.2.0 preview version.
Any help would be appreciated. Thanks
Upvotes: 4
Views: 4541
Reputation: 2816
After restarting visual studio it worked. The correct one is with "V" capital.
@bind-Value="blogTitle"
@bind-Value:event="oninput"
There is seems to be issue with Visual Studio 2019 preview. Whenever I add new nutget package it gives errors for missing references. I have to restart my visual studio so that newly added package takes effect. I hope updating visual studio with latest version will resolve the issue.
Upvotes: 4
Reputation: 581
With child components like InputDate, InputCheckbox etc use capital 'V' But for child components like textarea, label etc use lower case 'v'.
Upvotes: 0