Wie nennen jQuery popup-Fenster mit einer teilweisen Blick in ihn?

in meiner MVC-web-apps, die ich brauche, um erstellen Sie ein popup-Fenster mit einer Teilweisen Blick (enthält webgrid) in es,
Das problem ist die partielle view die Daten nicht zeigen, dass Sie auf die dialogbox, sehe ich nur die Titel. es scheint, ich habe ein problem mit dem controller-Aufruf, wie gut, bekannte bitte ich die dynamische Erstellung des Modells da das Modell erstellt wurde, dynamisch in den controller, nicht auf ein bestehendes Modell, nicht sicher, wie diese Art von Modell. Vielen Dank für jede Hilfe,
Dies ist meine codes:
dies ist die Schaltfläche in der razor-Ansicht:
das jQuery-codes:

  $(document).ready(function () {
            $("#GetEmp").click(function (event) {
                $("#popup").dialog({
                    width: 200,
                    hight: 400,
                    title: 'please select an employee',
                    modal: true,
                    open: function (event, ui) {
                        $(this).load("@Url.Action("Travel", "GetEmployee")");
                    }

                });
            });
        });

Dies ist controller-code:

    public class Employee
    {
        public string EmpName;
        public string EmpPhone;
        public string EmpNum;
    }

    [HttpPost]
    public ActionResult GetEmployee()
    {
        List<Employee> Emp = new List<Employee>
        {
               new Employee {  EmpName= "ScottGu", EmpPhone = "23232323", EmpNum="242342"},
               new Employee { EmpName = "Scott Hanselman", EmpPhone = "3435353", EmpNum="34535"},
               new Employee { EmpName = "Jon Galloway", EmpPhone = "4534535345345",   
                  EmpNum="345353"}

         };

        return PartialView("_EmpPartial", Emp );
    }

Und dieser Mitarbeiter ist Teilansicht: bitte beachten Sie, ich bin mit dynamischen Modell, da das Modell dynamisch erstellt wird.

 @model dynamic
 <ul>
 @foreach (var emp in Model) {
   <li>
     @emp.EmpName
   </li>   
   } 
  </ul>

Hallo, vielen Dank für die schnelle Antwort, ich habe es versucht zu Entfernen [HttpPost] und verändert @foreach zu @foreach (var emp im Modell-als Liste),
aber das wird nicht kompiliert, die mit einem roten Unterstrich in es. muss ich halten, @ - Modell dynamische in meinem partial view?

InformationsquelleAutor user2949042 | 2013-11-16
Schreibe einen Kommentar