Route Not Being Hit In ASP.NET MVC 4 Child Class -
why first route being skipped second? first route has base controller class of second route, widgets inherits events, events "registration" method keeps getting hit.
url
widgets/v1/registrationwidget?eventid=3762
route
routes.maproutelowercase( "defaultwidget", "widgets/v{version}/{action}widget", new { controller = "widgets", action = "notfound", version = 1, slug="event" }, new { version = @"\d+" } ); routes.maproutelowercase( "namedevent", "{id}/{slug}/{action}", new { controller = "event", action = "index", slug = "event" }, new { id = @"\d+" } );
widget controller
public partial class widgetscontroller : eventcontroller { public virtual actionresult registrationwidget(int version, int? eventid, string slug, int? divisionteamid = null, int? divisionid = null) { return getregistration(eventid, divisionid, divisionteamid, new widgetregistrationviewmodel(version)); }
event controller
public partial class eventcontroller : sitecontroller { public virtual actionresult registration(int? id, string slug, int? divisionteamid = null, int? divisionid = null) { return getregistration(id, divisionteamid, divisionteamid, new eventregistrationviewmodel()); }
according url widgets/v1/registrationwidget?eventid=3762
action name calculated registration
, not registrationwidget
expect, mvc use first route forward base class method.
Comments
Post a Comment