title: How do I pass data between controllers and overloaded actions?
body: <p>I have one controller that takes a username and pass and checks against a database.  IF the user is authenticated, I want to call an overloaded action on another controller.</p>
  
  <p>My end goal is to authenticate a user against an old table from a MySQL db (I have this part working).  Once the user is authenticated, I would like to be able to "automagically" forward the person to the built in MVC registration page but I would like to populate some fields in the view using data obtained from the first controller (the old databse info).</p>
  
  <p>When I try something like what I have below I get an error about the Register() methods being ambiguous.  I've also tried using the [ActionName("Register2")] attribute but then the error returned says it cant find a method named Register2.</p>
  
  <pre><code>    public class MigrateAccountController : Controller
      {
          OldUserRepository oldDb = new OldUserRepository();
          public ActionResult Index()
          {
  
              return View();
          }
          [HttpPost]
          public ActionResult Index(User u)
          {
              if (oldDb.isValid(u.username, u.password))
                  return RedirectToAction("Register", "Account", u);
  
  
              return View(u);
          }
      }
      public class AccountController : Controller
      {
          public IFormsAuthenticationService FormsService { get; set; }
          public IMembershipService MembershipService { get; set; }
  
          protected override void Initialize(RequestContext requestContext)
          {
              if (FormsService == null) { FormsService = new FormsAuthenticationService(); }
              if (MembershipService == null) { MembershipService = new AccountMembershipService(); }
  
              base.Initialize(requestContext);
          }
          public ActionResult Register(User u)
          {
              return View(u);
          }
          public ActionResult Register()
          {
              ViewBag.PasswordLength = MembershipService.MinPasswordLength;
              return View();
          }
      }
  </code></pre>