mardi 4 août 2015

Partial view data not refreshing in mvc

i have a bootstrap table in asp.net mvc view with a link to open model dialog for selected item id. it calls action method and action methos returns partial view. every thing working on refreshing page but problem is everytime it is showing first time loaded vaues. what i observed in debug is action methos is not calling on every click , it called only for first time. i am not getting where to make change. below is my approach..

Here is HTML

<td>
<a href="~/Trainer/DislayTrainerDetails/@item.trainerid" aria-hidden="true" 
 style="cursor:pointer" data-toggle="modal" data-   
 target="#myModalTrainer">More</a>
 </td>

popup Model Code :

<div class="modal fade" id="myModalTrainer" tabindex="-1" role="dialog" 
aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
    <div class="modal-content">

    </div>
  </div>
</div>

Controller :

[OutputCache(NoStore = true, Duration = 0, VaryByParam = "*")]
    public ActionResult DislayTrainerDetails(int id)
    {
        ModelState.Clear();

        TrainerService tser = new TrainerService();

        var trainer = tser.GetAllTrainer();

        var c = from i in trainer where i.trainerid == id select i;

        return View("_PartialTrainerDetails", c.FirstOrDefault());
    }

please help in this.. thanks in advance.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire