title: Where is value of "returnUrl" set in MVC 5? It always takes me to /Home/Index
body: <p>It is null everywhere I find it during runtime.</p>
  
  <p>I've got all the bells and whistles that halfway come with MVC 5 Template VS 2013.
  I figured out all the extra Indentity and DataAnnotations stuff and it all works. (40 files and 5 tables later sheez).</p>
  
  <p>But when signing in it all follows through but the registered user gets redirected to a "Home/Index" page, the default page that comes with template. I want them to get somewhere else, like "PickLocation".</p>
  
  <p>Now nowhere in my code can I find "/Home/Index" referenced by searching the entire solution. In Web.config the authentication mode is set to "none".</p>
  
  <p><em>Here is my Register link in _LoginPartial.cshtml:</em></p>
  
  <pre><code>&lt;li&gt;@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink", style = "color:white;" })&lt;/li&gt;
  </code></pre>
  
  <p>Somehow it heads for the HomeController.
  <em>Here is the Home Controller ActionResult that I can put a breakpoint to prove it was hit:</em></p>
  
  <pre><code>public class HomeController : Controller
  {
      public ActionResult Index()
      {
          ViewBag.Notice = "This is coming from Home Controller";
          return View();
      }
  </code></pre>
  
  <p>In my AccountController the Login ActionResult returns "null" for the "returnURL" parameter. On Success (which is what happens) it goes to "return RedirectToLocal(returnUrl);" Where is this set? Nowhere can I find value of returnURL or where it is set and I don't want to continue to end up on the MS default Home/Index page that comes with the template. Log Out also goes to Home/Index page. I set IIS default page to "PickLocation.cshtml" but no luck</p>
  
  <p><em>Here is the Login Action code here:</em></p>
  
  <pre><code>public async Task&lt;ActionResult&gt; Login(LoginViewModel model, string returnUrl)
  {
      if (!ModelState.IsValid)
      {
          return View(model);
      }
  
      // This doesn't count login failures towards account lockout
      // To enable password failures to trigger account lockout, change to shouldLockout: true
      var result = await SignInManager.PasswordSignInAsync(model.Email, model.Password, model.RememberMe, shouldLockout: false);
      switch (result)
      {
          case SignInStatus.Success:
              return RedirectToLocal(returnUrl);
  </code></pre>
  
  <p>Edit:
  <em>I just remembered someone is going to ask if this is set in RouteConfig.cs. .. .no it's not.</em></p>
  
  <pre><code>    public static void RegisterRoutes(RouteCollection routes)
      {
          routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
          //routes.MapRoute(
          //    name: "Default",
          //    url: "{controller}/{action}/{id}",
          //    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
          //);
  
          routes.MapRoute(
              name: "Default",
              url: "{controller}/{action}/{id}",
              defaults: new { controller = "Stores", action = "PickLocation", id = UrlParameter.Optional }
          );
  
      }
  </code></pre>
  
  <p>Here is the AccountController Login GET "method"</p>
  
  <pre><code>// GET: /Account/Login
  [AllowAnonymous]
  public ActionResult Login(string returnUrl)
  {
      ViewBag.ReturnUrl = returnUrl;
      return View();
  }
  </code></pre>
  
  <p>But the question still stands: "where in the heck is the project/solution getting the "/home/index" that it sends me back to after registering or logging off? No where does the "/home/index" show up in a search. </p>