Is there anything in MVC that is equivalent to asp: repeater of Web Forms?

0

I am putting together a form where some fields may or may not be repeated, for example:

  

Course 1:

  • Course [input text]
  • Institution [input text]
  • Completion year [input text]
  

Course 2:

  • Course [input text]
  • Institution [input text]
  • Completion year [input text]
  

Course ... (n):

In WebForms I would use a asp:repeater and would get the result by the submit of form, in MVC is there something equivalent so that I can get the values entered in these inputs dinâmicos by giving submit on the page? If it does not exist, could you tell me a way.

    
asked by anonymous 14.09.2017 / 20:40

2 answers

0

If you specify the name of the input so name="exemplo[]" , and in the controller put (string[] exemplo) , it will understand. So try to see.

    
15.09.2017 / 18:51
0

Hello @Deividson, so I understand you have a list of courses want to put your elements in html, good for this you can be using a foreach and building your structure

@foreach(var curso in lstCursos){
  curso.Curso
  curso.Instituição
  curso.Ano conclusão
}
    
14.09.2017 / 23:42