ASP.NET MVC - How can I set the Default Value in a Strongly Typed TextArea?
问题 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? 回答1: You can specify the value for Description property in the controller action when creating the model, and pass that model to the View: public ViewResult Create() { var model = new MyPageModel() { Description = "Description: "; }