ASP.NET MVC3 Complex Routing Issue -
i have following default route set , works fine:
routes.maproute( "default", // route name "{controller}/{action}/{id}", // url parameters new { controller = "home", action = "index", id = urlparameter.optional } // parameter defaults );
here example of successful route me: "/positiondetail/candidates/2"
this fine , dandy, issue have want set route goes deeper. i.e. "/positiondetail/candidates/2/getmorecandidates" , "/positiondetail/candidates/2/resume/3" resume action want perform, , 3 id. note: each of these route load new page, , not partial view.
how set this, , 'positiondetail' controller like?
for example, second task may follows:
public actionresult resume(int candidateid, int resumeid) { return view(); }
in routing:
routes.maproute( "resume", // route name "{controller}/candidates/{candidateid}/{action}/{resumeid}", // url parameters new { controller = "positiondetail", action = "resume", candidateid = urlparameter.optional, resumeid= urlparameter.optional } );
for fist task - same logic
Comments
Post a Comment