Get the name of the view from inside the view.

Posted by stacker on Stack Overflow See other posts from Stack Overflow or by stacker
Published on 2010-05-21T20:14:01Z Indexed on 2010/05/21 20:20 UTC
Read the original article Hit count: 175

Filed under:
    [HttpGet]
    public ActionResult LogIn(string username)
    {
        if (username == null)
            return View("404");

        return View("LogInAdvanced");
    }

Inside the view a want to get the view file name: LogInAdvanced or 404.

© Stack Overflow or respective owner

Related posts about asp.net-mvc