{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Templates/issues/296","labels_url":"https://api.github.com/repos/aspnet/Templates/issues/296/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Templates/issues/296/comments","events_url":"https://api.github.com/repos/aspnet/Templates/issues/296/events","html_url":"https://github.com/aspnet/Templates/issues/296","id":114728257,"number":296,"title":"Correct generated `id`s and `name`s for CurrentLogins fields","user":{"login":"dougbu","id":6431421,"avatar_url":"https://avatars.githubusercontent.com/u/6431421?v=3","gravatar_id":"","url":"https://api.github.com/users/dougbu","html_url":"https://github.com/dougbu","followers_url":"https://api.github.com/users/dougbu/followers","following_url":"https://api.github.com/users/dougbu/following{/other_user}","gists_url":"https://api.github.com/users/dougbu/gists{/gist_id}","starred_url":"https://api.github.com/users/dougbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougbu/subscriptions","organizations_url":"https://api.github.com/users/dougbu/orgs","repos_url":"https://api.github.com/users/dougbu/repos","events_url":"https://api.github.com/users/dougbu/events{/privacy}","received_events_url":"https://api.github.com/users/dougbu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":13,"created_at":"2015-11-03T02:18:09Z","updated_at":"2015-11-03T02:24:03Z","closed_at":null,"body":"_From @bitcrazed on October 29, 2015 0:20_\n\nIn my `form`, the following code ...\r\n\r\n    <input asp-for=\"@account.LoginProvider\" type=\"hidden\" />\r\n    <input asp-for=\"@account.ProviderKey\" type=\"hidden\" />\r\n\r\n... generates the following HTML:\r\n\r\n    <input type=\"hidden\" id=\"account_LoginProvider\" name=\"account.LoginProvider\" value=\"Facebook\" />\r\n    <input type=\"hidden\" id=\"account_ProviderKey\" name=\"account.ProviderKey\" value=\"...\" />\r\n\r\nThis HTML is incorrect - the `account.` and `account_` prefixes are unnecessary and causes the receiving controller method to not receive these values:\r\n\r\n    public async Task<IActionResult> RemoveLogin(string loginProvider, string providerKey)\r\n\r\nThe HTML should be:\r\n\r\n    <input id=\"loginProvider\" name=\"loginProvider\" value=\"Facebook\" type=\"hidden\" />\r\n    <input id=\"providerKey\" name=\"providerKey\" value=\"...\" type=\"hidden\" />\r\n\r\nThe latter HTML will be dispatched correctly to the receiving controller\n\n_Copied from original issue: aspnet/Mvc#3437_"},"comment":{"url":"https://api.github.com/repos/aspnet/Templates/issues/comments/153219481","html_url":"https://github.com/aspnet/Templates/issues/296#issuecomment-153219481","issue_url":"https://api.github.com/repos/aspnet/Templates/issues/296","id":153219481,"user":{"login":"dougbu","id":6431421,"avatar_url":"https://avatars.githubusercontent.com/u/6431421?v=3","gravatar_id":"","url":"https://api.github.com/users/dougbu","html_url":"https://github.com/dougbu","followers_url":"https://api.github.com/users/dougbu/followers","following_url":"https://api.github.com/users/dougbu/following{/other_user}","gists_url":"https://api.github.com/users/dougbu/gists{/gist_id}","starred_url":"https://api.github.com/users/dougbu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dougbu/subscriptions","organizations_url":"https://api.github.com/users/dougbu/orgs","repos_url":"https://api.github.com/users/dougbu/repos","events_url":"https://api.github.com/users/dougbu/events{/privacy}","received_events_url":"https://api.github.com/users/dougbu/received_events","type":"User","site_admin":false},"created_at":"2015-11-03T02:24:03Z","updated_at":"2015-11-03T02:24:03Z","body":"One potential fix here would combine ideas discussed above and leave the action code untouched:\r\n```\r\n  @for (var index = 0; index < Model.CurrentLogins.Count; index++)\r\n  {\r\n     ... asp-for=\"@Model.CurrentLogins[index].LoginProvider\" name=\"loginProvider\" ...\r\n  }\r\n```\r\n\r\nThe above would generate unique `id` attributes and align the `name`s with those the action expects. It's a bit brittle because the action's parameter names are an important part of the contract."}}