Cannot resolve view when view is in subdirectory

Posted by devzero on Stack Overflow See other posts from Stack Overflow or by devzero
Published on 2010-06-08T11:59:41Z Indexed on 2010/06/08 12:02 UTC
Read the original article Hit count: 254

Filed under:
|

We have a MVC 2.0 / c# 4.0 application that we develop visual studio. We have a part of the site (admin) that we have put in it's own sub directory and with its own routing rules:

routes.Add("DomainRoute", new DomainRoute(
            ConfigurationManager.AppSettings["adminDomain"], // Domain with parameters
            "{controller}/{action}/{id}",    // URL with parameters
            new { controller = "AdminPage", action = "Admin", id = "", isAdmin = true }  

We have all the views for the admin site inside an admin sub folder so that you get paths like: \views\admin\auth\login.aspx

In the \controllers\admin\authController.aspx file I have a function called login:

    public ActionResult Login()
    {
        return View();
    }

This works just as it should, ie if i go admin.localhost\auth\login I go to the login page. But if I do a right click in visual studio and "go to view" i get an error "unable to go to matching view". Is there anyway to solve this?

© Stack Overflow or respective owner

Related posts about asp.net-mvc-2

Related posts about c#4.0