Paging with jQuery and ASP.NET MVC

0
I'm looking for a number of ways to do paging with Ajax and ASP.NET MVC, so far I've been able to show all the data in the database but I'm not able to show one at a time.

In this part I wanted to show only one question and as soon as it answered I would go to question number 2.

ViewCode

@{intcount=1,countR=0;}@foreach(varquestionsinModel){<divclass="Question" style="padding: 2%;">

      @questions.descricaoQuestao
      @questions.numeroQuestao
    </div>
    <div class="Choices" style="margin-left: 8%;">

        @foreach (var choice in questions.Alternativas)
        {
            @choice.valorAlternativa
            <label class="radio-inline">
               <input type="radio" name="@string.Format("{0}{1}", "inlineRadioOptions",count)" id="@string.Format("{0}{1}", "inlineRadio", countR)" value="@choice.descricaoQuestao " style="margin-left: -16px;"> @choice.descricaoQuestao
            </label><br />
            countR++;
        }

    </div> <!--END Choices-->
}

And the controller code

  GuialetoModel db = new GuialetoModel();
    public ActionResult Index(int? pag )
    {
        int tamanho = 1;
        int numeroPagina = pag ?? 1;

        IQueryable<QuestoesVM> questions = null;
        questions = db.Questoes.Select
                    (p => new QuestoesVM
                    {
                        idQuestao = p.idQuestao,
                        descricaoQuestao = p.descricaoQuestao,
                        numeroQuestao = p.numeroQuestao,
                        Alternativas = p.Alternativas.Select(q => new AlternativasVM
                        {
                            idAlternativas = q.idAlternativas,
                            descricaoQuestao = q.descricaoQuestao,
                            valorAlternativa = q.valorAlternativa

                        }).ToList()
                    });

        return View(questions);
    }

Would anyone have a light for this problem?

    
asked by anonymous 23.01.2018 / 02:23

0 answers