• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 729
  • Last Modified:

MVC View Foreach Textbox Edit?

I'm considering using a foreach in my view but unsure if I can edit the textboxes. Maybe I'm using too many foreach statements. Help!

@model ViewModels.MyViewModels.Theme

@foreach (var category in Model.Theme)
   @foreach(var product in theme.Products)
      @foreach(var order in product.Orders)
1 Solution
StephanLead Software EngineerCommented:
If you want to use the html...for() extension, you need to have the correct model for it.
But you can also use @Html.Label and specify te name and value.

Same thing for Html.TextBoxFor --> Html.TextBox
WorknHardrAuthor Commented:
Cool, thx
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now