title: Asp.Net MVC - Overload Action method
body: <p>I created an asp.net mvc web site </p>
  
  <p>My problem is how to implemented overload action method</p>
  
  <p>Controller</p>
  
  <pre><code>
      public ActionResult Index(int id)
      {
          //code
          return View(model);
      }
  
      public ActionResult Index()
      {
          //code  
          return View(model);
      }
  </code></pre>
  
  <p>View</p>
  
  <pre><code>
      &lt;div id="menucontainer"&gt;
              &lt;ul id="menu"&gt;          
                      &lt;li&gt;&lt;%= Html.ActionLink("Home", "Index", "Home")%&gt;&lt;/li&gt;
                      &lt;%if (Page.User.Identity.IsAuthenticated)
                        {%&gt;
                      &lt;li&gt;&lt;%= Html.ActionLink("Profilo", "Index", "Account")%&gt;&lt;/li&gt;
                      &lt;%} %&gt;
                      &lt;li&gt;&lt;%= Html.ActionLink("About", "About", "Home")%&gt;&lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/div&gt;
  </code></pre>
  
  <p>Usercontrol (ascx) inserted in the View. This usercontrol lists the friends of the profile (view) </p>
  
  <pre><code>
     &lt;td&gt;
              &lt;%= Html.ActionLink(Html.Encode(item.Nominativo), "Index", "Account", new { id = item.IdAccount }, null)%&gt;
          &lt;/td&gt;
  </code></pre>
  
  <p>Global asax</p>
  
  <pre><code>
      public static void RegisterRoutes(RouteCollection routes)
          {
              routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
              routes.MapRoute(
                  "Default", 
                  "{controller}/{action}/{id}", 
                  new { controller = "Home", action = "Index", id = UrlParameter.Optional } 
              );
          }
  </code></pre>
  
  <p>when i click the action Index in the view, return the error "Can not find the resource... ecc.."</p>
  
  <p>I found several answer for this problem (using attribute ecc..) but is not works.</p>
  
  <p>There's a way to do that? I must add a maproute in a global asax?</p>
  
  <p>thanks so much for your replies</p>