C
C#3mo ago
cocKy

Default value to textarea in .net core MVC

<textarea asp-for="Description" class="form-control">@ViewBag.Product.Description</textarea>
<textarea asp-for="Description" class="form-control">@ViewBag.Product.Description</textarea>
Based on the example above, I want to add a default value to the textarea since it is a page for user to update the item.
1 Reply
Angius
Angius3mo ago
Don't use ViewBag The default value will be whatever you have in the model
Want results from more Discord servers?
Add your server