title: ASP.NET MVC Route Default values
body: <p>i defined two routes in global.asax like below</p>
  
  <pre><code>context.MapRoute("HomeRedirect", "",
                              new
                              {
                                  controller = "Home",
                                  action = "redirect"
                              });
  
  context.MapRoute("UrlResolver", "{culture}/some",
                              new
                              {
                                  culture = "en-gb",
                                  controller = "someController",
                                  action = "someAction"
                              },
                              new
                              {
                                  culture = new CultureRouteConstraint()
                              });
  </code></pre>
  
  <p>according to above definition, when user request mysite.com/ redirect action of HomeController should be called and in that:</p>
  
  <pre><code>public class HomeController : Controller
  {
      public ActionResult Redirect()
      {
          return RedirectToRoute("UrlResolver");
      }
  }
  </code></pre>
  
  <p>i want to redirect user to second defined route on above, so also i specified default values for that and some Constraint for each of those. but when <code>RedirectToRoute("UrlResolver")</code> turns, no default values passed to routeConstraints on second route and <code>No route in the route table matches the supplied values</code> shows.</p>
  
  <p><strong>update</strong></p>
  
  <p>my CultureRouteConstraint:</p>
  
  <pre><code>public class CultureRouteConstraint : IRouteConstraint
  {
      bool IRouteConstraint.Match(HttpContextBase httpContext, Route route, string parameterName, RouteValueDictionary values, RouteDirection routeDirection)
      {
          try
          {
              var parameter = values[parameterName] as string;
              return (someCondition(parameter));
          }
          catch
          {
              return false;
          }
      }
  }
  </code></pre>
  
  <p>now values parameter haven't culture key/value, but route parameter have that.</p>