How can I write the following in MVC?
<input type="text" name="ProjectList[' + count++ + '].ID" value = ' + value + ' />
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.
Use code expressions in
<%= ... %>block in the attributes.If the
valueis meant to be another property of theProjectListitem… then setting a local variable would be easier:Albeit that the HTML helpers (see other answer) provides a better approach.
NB. In .NET 4 prefer
<%: ... %>to ensure things are HTML Encoded.