Well, I have the following problem.
I have to use a function in JavaScript or JQuery to add new fields to populate and save in the database. In these fields I have to use a DropDown, but I do not know how I'll get the data from the database. I use telerik.
What I have is this
$("#incremento").click(function () {
var acrescentar = '@Html.DropDownListFor(model => model.Id_dis, new SelectList(ViewBag.Disciplina, "Id_dis", "Nome"), new { @class = "form-control" })';
$('#etapa').append(acrescentar);
});
var disciplina = from disci in Documento_Caract_BD.DocumentoCaractConnection.Model.
Tb_disciplinas.OrderBy(o => o.Nome).ToList()
select new
{
Id_dis = disci.Id_dis,
Nome = disci.Nome
}
into myDisciplina
select myDisciplina;
ViewBag.Disciplina = disciplina.ToList();
Does anyone have any ideas?