Suppose I have a list of elements in a view:
<% Dim valor As New List(Of Integer)
For i As Integer = 0 To 5%>
<%valor.Add(i)%>
<% Next%>
I send them to a modal using data in this way:
<a href="#" data-toggle="modal" data-target="#modal_noticia_editar" data-valores='<%:valor%>' data-noticiaid='<%: item.IdNoticia%>' data-titulo='<%: item.TituloNoticia%>' data-descripcion='<%: item.DescripcionNoticia%>' class="noticia_edit">Editar</a>
And when the modal opens, I see data where I do it this way:
$('.noticia_edit').click(function (e) {
e.preventDefault();
NoticiaID = $(this).data('noticiaid');
Titulo = $(this).data('titulo');
Descripcion = $(this).data('descripcion');
valores = $(this).data('valores');
$("#modal_noticia_editar input[name=noticiaid]").val(NoticiaID);
$("#modal_noticia_editar input[name=titulo]").val(Titulo);
$("#modal_noticia_editar input[id=Descripcion_edit]").val(Descripcion);
$("#modal_noticia_editar input[id=foto_multi]").val(valores);
});
In this line $ ("# modal_noticia_editar input [id = foto_multi]"). val (); At val, I must pass the "values" list. For this I need to go through the list and I would like to know how to send the elements of list values with jquery or javascripts to the val input [id = foto_multi] ") so that the elements of this list are displayed.