0

I have just started playing with the Beta and discovered a bit of black magic in there. When I look at _LoginPartial.cshtml the line that builds the Register link simply says:

@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink", data_dialog_title = "Registration" })

The link rendered on the browser says /Account/Register. However, the form in the Register view renders the action as /Account/JsonRegister based on ViewBag.FormAction value. Where was this value set? I have a suspicion it's something to do with that ContextDependentView returned by the Register action but can't quite figure out how or why.

Any ideas please?

codedog
  • 2,488
  • 9
  • 38
  • 67

1 Answers1

2

The real magic is in the AjaxLogin.js file, which modifies the link to add the content=1 querystring parameter that is used in ContextDependentView to decide whether to send back the json form or the regular form.

This is all just jquery stuff that most people don't bother to look at.

Erik Funkenbusch
  • 92,674
  • 28
  • 195
  • 291