0

I like the way MVC4 manage the new logon screen: it is possible to have a modal dialog showed.

enter image description here

I tried to reproduce the same behavior in the same solution for another view. But it doesn't work because Request.QueryString["content"] is null. I don't know why. In fact, there is an action method called ContextDependentView (generated by the MVC template) where the trick occurred. Here it is:

    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();
        }
    }

If the value of Request.QueryString["content"] is not null then we display a partial view (modal jQuery) otherwise it is a classic view.

Can someone help me understand why this is not working?

PS: another thread already exists but without any solution.

1

1 Answer 1

2

The login and register links are bound to a click handler in AjaxLogin.js which then adds content=1 in loadAndShowDialog

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.