title: How to solve this same routing pattern issue in asp.mvc routing?
body: <p>I'm practicing MVC routing and now I'm stuck in a situation which I don't understand how to solve. I have two controllers and action in both controllers and two routes in RouteConfig class. Here:</p>
  
  <p>RouteConfig</p>
  
  <pre><code>    routes.MapRoute(
          name: "Students",
          url: "{Class}/{Students}",
          defaults: new { controller = "Class", action = "Students" });
  
          routes.MapRoute(
          name: "SubjectDetail",
          url: "{Class}/{Subject}",
          defaults: new { controller = "Subject", action = "SubjectDetail"});
  </code></pre>
  
  <p>Now the problem is when I go to the class/Students url it works fine but in case of class/subject it again redirects me to the class/Students url. I know there is some route pattern mistakes. How to solve this issue. Thanks.</p>