{"action":"created","issue":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/5079","repository_url":"https://api.github.com/repos/aspnet/Mvc","labels_url":"https://api.github.com/repos/aspnet/Mvc/issues/5079/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/Mvc/issues/5079/comments","events_url":"https://api.github.com/repos/aspnet/Mvc/issues/5079/events","html_url":"https://github.com/aspnet/Mvc/issues/5079","id":167508725,"number":5079,"title":"Html.Hidden() does not respect value passed in if present in ModelState.","user":{"login":"ctolkien","id":515955,"avatar_url":"https://avatars.githubusercontent.com/u/515955?v=3","gravatar_id":"","url":"https://api.github.com/users/ctolkien","html_url":"https://github.com/ctolkien","followers_url":"https://api.github.com/users/ctolkien/followers","following_url":"https://api.github.com/users/ctolkien/following{/other_user}","gists_url":"https://api.github.com/users/ctolkien/gists{/gist_id}","starred_url":"https://api.github.com/users/ctolkien/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ctolkien/subscriptions","organizations_url":"https://api.github.com/users/ctolkien/orgs","repos_url":"https://api.github.com/users/ctolkien/repos","events_url":"https://api.github.com/users/ctolkien/events{/privacy}","received_events_url":"https://api.github.com/users/ctolkien/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-07-26T02:36:25Z","updated_at":"2016-07-26T17:43:37Z","closed_at":null,"body":"Scenario:\r\n```csharp\r\npublic IActionResult Index(string id)\r\n{\r\n    return View();\r\n}\r\n```\r\n\r\nView:\r\n\r\n```csharp\r\n@Html.Hidden(\"id\", value: \"Hellooooooo\")\r\n```\r\n\r\nRequest via` /controller/index/wat`\r\n\r\nThis generates:\r\n\r\n```HTML\r\n<input id=\"id\" name=\"id\" type=\"hidden\" value=\"wat\">\r\n```\r\n\r\nWhereas I would expect:\r\n\r\n```HTML\r\n<input id=\"id\" name=\"id\" type=\"hidden\" value=\"Hellooooooo\">\r\n```\r\n\r\nThe documentation for that overload states: `Value: if non-null, value to include in the element`.\r\n\r\nSample repo:\r\nhttps://github.com/ctolkien/mvc-bug-repro\r\n\r\n\r\n\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/aspnet/Mvc/issues/comments/235347102","html_url":"https://github.com/aspnet/Mvc/issues/5079#issuecomment-235347102","issue_url":"https://api.github.com/repos/aspnet/Mvc/issues/5079","id":235347102,"user":{"login":"Eilon","id":202643,"avatar_url":"https://avatars.githubusercontent.com/u/202643?v=3","gravatar_id":"","url":"https://api.github.com/users/Eilon","html_url":"https://github.com/Eilon","followers_url":"https://api.github.com/users/Eilon/followers","following_url":"https://api.github.com/users/Eilon/following{/other_user}","gists_url":"https://api.github.com/users/Eilon/gists{/gist_id}","starred_url":"https://api.github.com/users/Eilon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Eilon/subscriptions","organizations_url":"https://api.github.com/users/Eilon/orgs","repos_url":"https://api.github.com/users/Eilon/repos","events_url":"https://api.github.com/users/Eilon/events{/privacy}","received_events_url":"https://api.github.com/users/Eilon/received_events","type":"User","site_admin":false},"created_at":"2016-07-26T17:43:37Z","updated_at":"2016-07-26T17:43:37Z","body":"Hmm don't all HTML helpers work this way? ModelState always takes precedence because it includes what is believed to be the \"latest updated value.\" It's there to preserve the user's input in case they perhaps typed in a value that isn't valid, but could still be corrected and then they could submit again.\r\n\r\nI believe this is the behavior all the way back to ASP.NET MVC 1.0."}}
{"actor":{"display_login":"Eilon"}}