string Id, MenuName, ApplicationId, Levels;
        public ActionResult EditorInterface(string Id,string MenuName,string ApplicationId,string Levels)
        {            ViewData["Id"] = Id;
            ViewData["MenuName"] = MenuName;
            ViewData["ApplicationId"] = ApplicationId;
            ViewData["Levels"] = Levels;
         
            return View();        }
        [HttpPost]
        public ActionResult Content()
        {
            GridDataContext grid = new GridDataContext();             Id = Request.Form["Id"];
             MenuName = Request.Form["MenuName"];
             ApplicationId = Request.Form["ApplicationId"];
             Levels = Request.Form["Levels"];            return RedirectToAction("EditorInterface", new { Id=Id,MenuName=MenuName,ApplicationId=ApplicationId,Levels=Levels});        }
值我已经传到EditorInterface中了 可是我load弹出EditorInterface的视图时,它都执行两遍EditorInterface方法,第二遍执行时 就又没有值了,所以还是传不上,不知道有什么方法解决没,谢谢了

解决方案 »

  1.   

    补充一下我弹出的代码是: function Editor() {
                var id = $("#table1").jqGrid("getGridParam", "selrow");//获取选中行的Id
                var rowData = $("#table1").jqGrid("getRowData", id); //获取选中行的数据
                var EditorConteng = { Id: rowData.Id, MenuName: rowData.MenuName, ApplicationId: rowData.ApplicationId, Levels: rowData.Levels };
                
                    $.ajax({                    url: '<%=Url.Content("~/Grid/Content/")%>',
                        type: 'post',
                        dataType: 'json',
                        data: EditorConteng,
                        success: function () {
                        },
                        complete: function () {
                            $("#Editor").html("").load('<%=Url.Content("~/Grid/EditorInterface/")%>');
                            $("#Editor").dialog("open");                    }                });
                
              
                    };
      

  2.   


    dataType:"html", // string
    success: function (html) {
      $("#Editor").html("").load(html);
      $("#Editor").dialog("open");
    },
    complete: function () {                    
    }你ajax的时候 返回的就是 你要的视图,不用再一次 去load那个视图了。
      

  3.   

    没有 试过, 理论应该可以的
    $("#Editor").html("").html(html);
     $("#Editor").dialog("open");
      

  4.   

    好了 谢谢啊 应该是这样的   $.ajax({                    url: '<%=Url.Content("~/Grid/Content/")%>',
                        type: 'post',
                        dataType: 'html',
                        data: EditorConteng,
                        success: function (html) {
                            $("#Editor").html(html);
                            
                        }
                    });
                    $("#Editor").dialog("open");
                    };