Load DropDownList Ajax (ASP.NET MVC 5)

0

I would like to know what to do or what steps to follow to be able to list a field in a table (in SQLServer) in a DropDownList with AJAX.

I am a development practitioner and I was assigned a project for internal use by the company, which focuses on improving employee productivity. According to the requirements, the App must have a horizontal and vertical movement behavior; To do this, use a library called fullPage.js , which is used to create full-screen scrolling websites (also known as single-page websites or one-page sites). For this reason, all interactions with the database must be done through Ajax since everything the user does is in a single main view and the user navigates through the site as if they were PowerPoint slides.

To the point ... In the first interaction view, the logged in user must choose two "Propositos" before continuing to the other activities.

I just want to list the "Description" of the "PropositosIn" table in one of the DropDownList, because I guess for the other one it would be the same procedure.

Vista

<form id="frmPropositos" name="frmPropositos" enctype="multipart/form-data">
                                <div class="row pl-3 pr-3">
                                    <br />
                                    <div class="col-md-6 col-xs-12 text-center">
                                        <h3 style="font-size:200%">
                                            <b>Interno</b>
                                            <span class="tooltip-demo">
                                                <i class="ion-ios-help pInterno" title="Cuando nuestra motivación es provocada por las consecuencias internas de nuestra propia conducta. Simplemente disfrutamos de una actividad o la vemos como una oportunidad para explorar, aprender y actualizar nuestros potenciales."></i>
                                            </span>
                                        </h3>
                                        <select class="custom-select" name="cmbPropositosInternos" id="cmbPropositosInternos">
                                            <option value="seleccionar">- Seleccionar -</option>
                                        </select>
                                    </div>
                                    <div class="col-md-6 col-xs-12 text-center">
                                        <h3 style="font-size:200%">
                                            <b>Externo</b>
                                            <span class="tooltip-demo">
                                                <i class="ion-ios-help pExterno" title="Nuestra motivación es originada por las consecuencias que provocan en otros nuestras conductas. Aparece cuando recibimos recompensas externas o evitamos el castigo."></i>
                                            </span>
                                        </h3>
                                        <select class="custom-select" name="cmbPropositosExternos" id="cmbPropositosExternos">
                                            <option value="seleccionar">- Seleccionar -</option>
                                        </select>
                                    </div>
                                </div><br />
                                <div class="row">
                                    <div class="col-md-12">
                                        <a id="btnContinuar" name="btnContinuar" class="btn btn-default "><b>Continuar</b></a>
                                    </div>
                                </div>                               
                            </form>

Model

Part of the Controller

I confess that I am very new to this and it is more than anything to give me an explanation or a step by step of what I should do since I have to implement this same in the other activities of the application. Thank you very much!

    
asked by Mateo Castaño Tobon 22.05.2018 в 17:54
source

0 answers