0

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

2 Answers 2

1

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.

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

Comments

0

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.

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.