J'ai un problème avec le routage de routage ulr pour l'application asp.net mvc3.asp.net mvc 3 zones et configuration de routage d'URL
Mon projet a cette structure:
- zones
- EmployeeReport
- Contrôleurs
- Rapport
- Vues
- Rapport
- Liste
- ....
- Rapport
- Contrôleurs
- EmployeeReport
- Contrôleurs
- Connexion
- Viwes
- Connexion
- ...
- Connexion
EmployeeReportAreaRegistration.cs:
public class EmployeeReportAreaRegistration : AreaRegistration
{
public override string AreaName
{
get
{
return "EmployeeReport";
}
}
public override void RegisterArea(AreaRegistrationContext context)
{
var routes = context.Routes;
routes.MapRoute(null, "vykazy/vykazy-zamestnance", new { Area = "EmployeeReport", controller = "Report", action = "List" });
}
}
Global.asax:
routes.MapRoute(null, "prihlasit", new { controller = "Login", action = "Login" });
routes.MapRoute("Default", "{controller}/{action}/{id}", new { controller = "Default", action = "Welcome", id = UrlParameter.Optional });
When i try load "http://localhost/app_name/vykazy/vykazy-zamestnance
i get this exception :
The view 'List' or its master was not found or no view engine supports the searched locations. The following locations were searched:
~/Views/Report/List.aspx
~/Views/Report/List.ascx
~/Views/Shared/List.aspx
~/Views/Shared/List.ascx
~/Views/Report/List.cshtml
~/Views/Report/List.vbhtml
~/Views/Shared/List.cshtml
~/Views/Shared/List.vbhtml
Eh bien, où je me trompe?
Merci
Hmm, j'ai AreaRegistration.RegisterAllAreas() sur le dessus de la fonction Application_Start() dans global.asax – Mennion
Oui, j'ai dossier EmployeeReportArea sous dossier zones. Fixé dans le premier commentaire. – Mennion
Mon erreur, le fait qu'elle cherchait la vue signifiait qu'elle trouvait la route. Essayez d'utiliser http://haacked.com/archive/2008/03/13/url-routing-debugger.aspx et voyez si cela aide. –