title: why i have to pass parameter as a querystring to Action Method in MVC?
body: <p>I'm new to <code>mvc</code>. I'm creating a test application in <code>mvc</code>.</p>
  
  <p><a href="http://www.asp.net/mvc/tutorials/mvc-4/getting-started-with-aspnet-mvc4/adding-a-controller" rel="nofollow">here</a> I've studied that <code>mvc</code> works with url as <code>/[Controller]/[ActionName]/[Parameters]</code></p>
  
  <p>But in my application i have to pass parameter as <code>/home/index?name=test</code>. I think it should work as <code>/home/index/test</code>. But it doesn't work in this way.</p>
  
  <p><strong>Here is <code>ActionMethod</code> in <code>homeController</code></strong></p>
  
  <pre><code> public ActionResult Index(String name)
      {
          ViewBag.name = name;
          return View();
      }
  </code></pre>
  
  <p><strong>Routing code in <code>Global.asax.cs</code></strong></p>
  
  <pre><code>public static void RegisterRoutes(RouteCollection routes)
      {
          routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
          routes.MapRoute(
              "Default", // Route name
              "{controller}/{action}/{id}", // URL with parameters
              new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
          );
  
      }
  </code></pre>
  
  <p><strong>Index.cshtml</strong></p>
  
  <pre><code>@{
  ViewBag.Title = "Index";
  Layout = "~/Views/Shared/_Layout.cshtml";
  
   }
  
    &lt;h2&gt;@ViewBag.name&lt;/h2&gt;
  </code></pre>
  
  <p>Can anyone help me to findout that why its not working in <code>/home/index/test</code> format.</p>
  
  <p>Thanks.</p>