title: ASP.NET Mvc - nullable parameters and comma as separator
body: <p>How should I define route in my global.asax to be able use nullable parameters and coma as separator?</p>
  
  <p>I'm trying to implement routing rule for my search users page like</p>
  
  <pre><code>"{Controller}/{Action},{name},{page},{status}"
  </code></pre>
  
  <p>Full entry from the Global.asax:</p>
  
  <pre><code>    routes.MapRoute(
          "Search",
          "{controller}/{action},{name},{page},{status}",
              new { controller = "User", action = "Find", 
                  name = UrlParameter.Optional,
                  page = UrlParameter.Optional,
                  status = UrlParameter.Optional  } 
      );
  </code></pre>
  
  <p>Routine defined like above works fine when I'm entering all parameters, but when some parameters are equal to null routing fails (for example "user/find,,,")</p>
  
  <hr>
  
  <p>According to <a href="/users/148403/clicktricity">Clicktricity</a> comment bellow - the singature of action method that handes the request:</p>
  
  <pre><code>public ActionResult Find(string userName, int? page, int? status)
  {
      // [...] some actions to handle the request
  
  }
  </code></pre>
  
  <p>On the beginning I was testing the route by VS debugger, now I'm using route debugger described on <a href="http://haacked.com/archive/2008/03/13/url-routing-debugger.aspx" rel="nofollow">Phil's Haack blog</a>. The tool confirm - that routing with null values is not properly handled (or I'm doing something wrong ;) )</p>