tags:

views:

28

answers:

2

i am new to asp.net MVC , i have created a new controller name "PersonController.cs" and a new view folder "Person" , now the problem is person controller searching view only in "Home" and "Shared" directory not in Person Directory any answer?

Error : The view 'Reject' or its master was not found. The following locations were searched: ~/Views/Home/Reject.aspx ~/Views/Home/Reject.ascx ~/Views/Shared/Reject.aspx ~/Views/Shared/Reject.ascx

A: 

Make sure you have something like this in your Global.asax file (usually called in RegisterRoutes):

routes.MapRoute(
            "Default",
            "{controller}/{action}",
            new { controller = "Home", action = "Index" }
        );

Also you must have an action named Reject in the Person cotroller.

Cristi Todoran
+1  A: 

Hello,

Your link in the view your wanting to navigate from:

<%= Html.ActionLink("Person Link", "Reject", "Person") %>

Your PersonController:

public ActionResult Reject()
{
    return View("Reject");
}

Hope this helps.

James