Is this right? I am trying to display value in input box dynamically?
can anyone advice me is this corect approach? but still I am getting here only + + in input box?
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.
Html.DisplayForwill render a label in this case. If you want to write in this way just use<%= Model.Date.ToString() %>for the value attribute of the input.These HTML helpers will render the markup for you, don’t try and use them as methods to return data. You can get the data by just using
<%=Model.MyProperty%>as long as it is a strongy-typed view.Try just using
<%= Html.EditorFor(m => m.Date) %>OR
<%= Html.TextBoxFor(m => m.Date) %>(the EditorFor will automatically render a textbox anyway)OR
<%= Html.TextBox("Date", Model.Date) %>(this is not a strongly-typed helper, you’re doing the data binding yourself with the second argument)