Using the razor view engine, I have some code like the following:
@Html.TextAreaFor(model => model.Field, 20, 100, null)
How can I make this text area have a default value, i.e., what is normally in between <textarea> and </textarea>?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
It should work if you just populate the
Fieldproperty on the model with the default text. It will automatically insert the text when the markup is generated.If you look at a view for edit, you see that this is how it works.