How to pass a default value to a model bound input? its not working
@Html.TextBoxFor(model => model.City, new { @class="ctype", value="default city"})
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.
You could do this in the controller action rendering this view:
and then:
or if you want to use the HTML5 placeholder attribute you could do the following:
or if you use a weakly typed helper (absolutely not recommended):