I’m trying to make a TextArea have a default value.
<%: Html.TextAreaFor(Function(model) model.Description, 5, 10, New With {.Value = "Description: "})%>
This works properly in a TextBoxFor but doesn’t work in a TextAreaFor
Am I missing something very obvious?
You can specify the value for Description property in the controller action when creating the model, and pass that model to the View:
In the view:
Setting the value won’t work as the contents of a TextArea are specified between the opening and closing tags, not as an attribute.