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/R开发者_StackOverflow社区eject.ascx
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.
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.
精彩评论