I am new to the ASP.NET core MVC framework. I am trying to implement server-side validation on the form using tag helper in my MVC application. When I am trying to use asp-for tag helper, it is showing CS1061 error for the string that I am passing as a value of the tag helper.
Below is the code.
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
<body>
<form class="signup" id="form" onsubmit="return validateForm()" asp-action="CreateUser" method="POST">
<div class="form-div">
<div class="name-section">
<input class="textfields field-margin" type="text" placeholder="First Name" id="fname" name="firstname" asp-for="firstname"> // getting error here.
<input class="textfields" type="text" placeholder="Last Name" id="lname" name="lastname">
</div>
</form>
<body>
I couldn't figure out what is wrong here. Please let me know if additional details are required.
Thanks in advance!