Click here to Skip to main content
14,737,994 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900