Click here to Skip to main content
14,427,367 members
Rate this:
Please Sign up or sign in to vote.
See more:
I'm studying mvc and came across a problem, like loading the result into a dropdownlist.
I actually have two dropdownlists in the same template that I wanted to load, but showing me how to do one I believe I can do the second.
I know it sounds easy, but I'm taking a beating.
I have a button that sends for a query 3 fields, in the controller I see the data but I can not load a dropdpwnlist mustache.
my template
 </script>
    <script id="template-produto" type="x-tmpl-mustache">
        <tr>
            <td>
                <input class="form-control form-control-sm" type="text" placeholder="De">
            </td>
            <td>
                <input class="form-control form-control-sm" type="text" placeholder="Para">
            </td>
            <td>
                <input class="form-control form-control-sm" type="text" placeholder="Cliente">
            </td>
            <td>
//dropdownlist that should be given id and name 
            <select id=" "><option selected="selected" value="">Piloto</option></select>
            <td>
             <select id=" "><option selected="selected" value="">Carro</option></select>
            </td>
            <td>
                <input class="form-control form-control-sm" type="text" 
               placeholder="Tempo">
            </td>
            <td>
                <a class="btn btn-warning btn_remover" role="button">
                    
                </a>
            </td>
        </tr>
    </script>


I appreciate who can help

What I have tried:

public JsonResult RecuperarNN(string DT, string HI, string HF)
{
var ListaA = OperacaoModel.RecuperarListaAeroN(DT, HI, HF);

return Json( ListaA , JsonRequestBehavior.AllowGet);
// return (id and name)
}
function incluir_linha_produto() {

    $('#grid tbody').append(Mustache.render($('#template-produto').html() ));
}


I tried as the cod above
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100