Is it possible to create a single line iteration command in my non-razor MVC view that does the following:
@Model.Toys.Each(@<input name="Make@{@(item.Index + 1)}" type="hidden" value="@item.Item.Make" />)
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.
Even if something like this was possible I wold advice you against. It’s ugly. You may take a look at templated Razor delegates instead.
Or a simple loop:
or an editor template:
UPDATE:
It seems that you want to rewrite this code for WebForms. So: