i am using asp.net mvc3 and have two different type of request in same controller and i am facing error in accesing the correct method
Firstcondition
routes.MapRoute(
"Tag1", // Route name
"Tag/{no}", // URL with parameters
new { controller = "Tag", action = "TagCloud", no = UrlParameter.Optional } // Parameter defaults
);
In this case user will access Tag Controller like this http://xyz.com/tag OR http://xyz.com/tag/3 where number is actually page number
Secondcondition
routes.MapRoute(
"Tag", // Route name
"Tag/{tag}/{page}", // URL with parameters
new { controller = "Tag", action = "Index", tag = "tag", page = UrlParameter.Optional } // Parameter defaults
);
In this case user must give a name of tag in order to get detail page of that tag like this http://xyz.com/tag/mvc where mvc is the name of tag OR http://xyz.com/tag/mvc/3 where mvc is tag name and 3 is page no which is optional ,
now problem is that both are not working at same time , anyone which is on the top runs , and mvc skip the lower one . Please help and thanks in advance .
Try this: