Q:

Routing issue on MVC5 identity Register form

I'm using asp.net MVC 5 with Identity v2. My problem is that the URL being called back on a register failure has an issue as it is appending length=7 which generally means a problem with the routes, that I haven't been able to work out.
My register form is at localhost:44300/en-US/Account/Register and if you submit a form that returns an invalid server side validation (as an example, if the username is taken), then the form redirects you to localhost:44300/en-US/Account/Register?Length=7
This happens in the Register method:
    public async Task<ActionResult> Register(RegisterViewModel model)
    {
        if (ModelState.IsValid)
        {
            var user = new ApplicationUser() { UserName = model.Email, Email = model.Email };
            var result = await UserManager.CreateAsync(user, model.Password);
            if (result.Succeeded)
            {
                await SignInAsync(user, isPersistent: true);
                return RedirectToAction("Index", "Home");
            }
            else
            {
                AddErrors(result);
            }
        }

        // The following line seems to call the URL with ?length=7
        return View(model);
    }

I have the following route:
        routes.MapRoute(
            name: "Default",
            url: "{culture}/{controller}/{action}/{id}",
            defaults: new { culture = CultureHelper.GetDefaultCulture(), controller = "Home", action = "Index", id = UrlParameter.Optional }
        );

Edit:
My form tag is:
@using (Ajax.BeginForm("Register", "Account", new AjaxOptions
{
    InsertionMode = InsertionMode.Replace,
    HttpMethod = "POST",
    LoadingElementId = "loader",
    OnSuccess = "OnSuccess",
    OnFailure = "OnFailure "
}, new { @id = "localForm" }))

I'm not sure what the problem is, and it's not causing any issues, but I'd love to get to the bottom if it as something is obviously wrong!

A:

ok, I fixed the problem, I was missing a value for route dictionary:
@using (Ajax.BeginForm("Register", "Account", null, new AjaxOptions
{
    InsertionMode = InsertionMode.Replace,
    HttpMethod = "POST",
    LoadingElementId = "loader",
    OnSuccess = "OnSuccess",
    OnFailure = "OnFailure "
}, new { @id = "localForm" }))

