0
Well, I have the following problem.
I have to use a Javascript or Jquery function to add new fields to fill and save in the database. In these fields I have to use a Dropdown, but I don’t know how to get the data from the database. Utilizo Telerik.
What I got 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 idea?
Could you please post the code you are using?
– PauloHDSousa
Create new fields on the screen and submit this form to the server?
– RBoschini
I posted just below the doubt
– Bruno Hilário
What’s the c#? code like you’re doing? You want to take the content of these drop down lists and add it to the database?
– PauloHDSousa
I am going through Viewbag the data.
– Bruno Hilário