解决方案 »

  1.   

    Creat这个视图对应的ActionResult 必须也在同一个Controller里,要不然就无法跳转,如果不在可以直接写相对路径 如:
    return View("~/Views/SomeOtherDirectory/Create.cshtml");
      

  2.   

    我是这样写的,没有错。但是没有反应。
    然后,如果我在JS里面加上回调函数。会发现,回调函数的返回文本就是这个HTML文件的内容。
      

  3.   

    直接在js 调用 create 的controller 就好了哇;$.ajax({
                    type: "POST",
                    url: "/Bom/Create",
                    datatype: "json",
                    data: { data: jsonObject }
                });controller:public ActionResult Create(){
        return view();
    }
      

  4.   

    $.ajax({
                    type: "POST",
                    url: "/Bom/ProcessRequest",
                    datatype: "json",
                    data: { data: jsonObject },
    success:function(data){
    [email protected]("Create")
    }
                });
      

  5.   

    public ActionResult Index()
            {
                return View();
            }
    Action默认的返回的是和方法同名的视图,向相面这个就是返回Index视图,如果你想转到指定视图,就需要指定视图的名称或路径,如:
    return ViewContext("OtherIndex");//转到OtherIndex
            return View("~Views/aaa/OtherIndex.cshtml");
    你可以尝试一下返回视图的路径。
      

  6.   


    这可方法可以,但有另一个问题,就是create有参数时,怎么给传参数。参数类型是model。
      

  7.   

    post时候直接传参数、或者重定向传到url里