1
Mon parcours ressemble:ne ramasse pas la route
routes.Add(new Route("{companyName}/{action}/{id}", new MvcRouteHandler())
{
Defaults = new RouteValueDictionary(new { controller = "CompanyController", action = "Index", id = 1 }),
}
);
mon action:
public ActionResult Index(string companyName, string id)
{
Response.Write(companyName);
Response.End();
return ViePage("~/views/company/index.aspx");
}
Vous n'avez pas non plus besoin de spécifier le chemin d'accès réel au fichier de la page d'affichage. Le framework MVC trouvera la vue qui correspond à View/{Controller}/{Action} – scottm
Good Point Scott! aussi. ViePage ne va pas aller trop loin. mais c'est probablement juste une faute de frappe dans le post :) – Patricia
ah, a ajouté le contrôleur à la fin, merci Patricia! – mrblah