Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/loops/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Asp.net mvc 4 使用MVC4生成模态jQuery局部视图不起作用_Asp.net Mvc 4 - Fatal编程技术网

Asp.net mvc 4 使用MVC4生成模态jQuery局部视图不起作用

Asp.net mvc 4 使用MVC4生成模态jQuery局部视图不起作用,asp.net-mvc-4,Asp.net Mvc 4,我喜欢MVC4管理新登录屏幕的方式:可以显示模式对话框 我试图在同一个解决方案中为另一个视图重现相同的行为。但它不起作用,因为Request.QueryString[“content”]为空。我不知道为什么。事实上,有一个名为ContextDependentView(由MVC模板生成)的操作方法发生了这个技巧。这是: private ActionResult ContextDependentView() { string actionName = Control

我喜欢MVC4管理新登录屏幕的方式:可以显示模式对话框

我试图在同一个解决方案中为另一个视图重现相同的行为。但它不起作用,因为Request.QueryString[“content”]为空。我不知道为什么。事实上,有一个名为ContextDependentView(由MVC模板生成)的操作方法发生了这个技巧。这是:

    private ActionResult ContextDependentView()
    {
        string actionName = ControllerContext.RouteData.GetRequiredString("action");
        if (Request.QueryString["content"] != null)
        {
            ViewBag.FormAction = "Json" + actionName;
            return PartialView();
        }
        else
        {
            ViewBag.FormAction = actionName;
            return View();
        }
    }
如果Request.QueryString[“content”]的值不为空,那么我们将显示一个局部视图(模态jQuery),否则它是一个经典视图

有人能帮我理解为什么这不起作用吗


PS:另一个线程已存在,但没有任何解决方案。

登录和注册链接绑定到AjaxLogin.js中的单击处理程序,该处理程序随后在loadAndShowDialog中添加content=1

按照此链接上的说明解决问题: