Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

I have the following project structure

UserController code:

public class UserController : Controller
    {

        public ActionResult Login()
        {
            return View(ValidationResult.OK);
        }
    }

AdminController code:

public class AdminController : Controller
    {
        public ActionResult Login()
        {
            return View(ValidationResult.OK);
        }
}

Routes

public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                "Default", // Route name
                   "{controller}/{action}/{id}", // URL with parameters
                new { controller = "Home", action = "Index", id = UrlParameter.Optional } 
            );

        }

When I try to navigate to http://localhost:2334/admin/login I get "Server Error in '/admin/login' Application. The resource cannot be found. Requested URL: /admin/login/"

When I try to navigate to http://localhost:2334/user/login I get *"Server Error in '/admin/login' Application."HTTP Error 404 - Not Found. *

I can't understand anything :(

share|improve this question
    
Under which server are you running this? Have you tried recompiling and restarting it? –  gw0 Jul 15 '11 at 6:49
    
Check out your _ViewStart.cshtml in the Views folder. –  Peanutbag Jul 15 '11 at 6:51
    
asp.net developement server –  VoimiX Jul 15 '11 at 6:52
    
@{ Layout = "~/Views/Shared/Head.cshtml"; } –  VoimiX Jul 15 '11 at 7:20
    
Honestly, i don't know... I would create a default project of the same type and compare the generated files with the ones you have right now. And other information that you can give? –  Peanutbag Jul 15 '11 at 8:22
show 1 more comment

1 Answer

Don't know, probably stupid assumption: Did you define appropriate views for your controllers? Check this:

/Views/Admin/Login.cshtml
/Views/User/Login.cshtml
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.