{"id":273353,"date":"2016-02-01T16:51:02","date_gmt":"2016-02-01T13:51:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=273353"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=273353","title":{"rendered":"\u041f\u043e\u043b\u043d\u043e\u0435 \u0440\u0443\u043a\u043e\u0432\u043e\u0434\u0441\u0442\u0432\u043e \u043f\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044e ASP.NET Core 1.0 (aka ASP.NET 5) Tag Helpers"},"content":{"rendered":"<p>       \u0422\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u044b (Tag Helpers) \u2013 \u043d\u043e\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f MVC, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 HTML \u043a\u043e\u0434\u0430. \u041e\u043d\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0435 HTML \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0432\u0438\u0436\u043a\u043e\u043c Razor \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0422\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u044b \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0434\u043b\u044f HTML Helpers, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043e\u043d\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0442\u0440\u0443\u0434\u043d\u043e \u0438\u043b\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e HTML Helpers. \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0430 \u0441\u0432\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438. \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u044b, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0432 MVC 6 (ASP .NET Core 1.0, \u043a\u0430\u043a \u0441\u0442\u0430\u043b\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0434\u0430\u0432\u043d\u043e).<br \/>  <a name=\"habracut\"><\/a><\/p>\n<h2>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438<\/h2>\n<p>  \u0415\u0441\u043b\u0438 \u0432\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0435 \u043d\u043e\u0432\u044b\u0439 MVC 6 \u043f\u0440\u043e\u0435\u043a\u0442 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Visual Studio, \u0442\u043e \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u044b\u0435 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u044b \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u041c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u044b \u0438\u0437 \u043b\u044e\u0431\u043e\u0439 \u0441\u0431\u043e\u0440\u043a\u0438 \/ \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0430 \u0438\u043c\u0435\u043d, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443 <b>@addTagHelper<\/b> \u0432 cshtml \u0444\u0430\u0439\u043b\u0430\u0445.  <\/p>\n<pre><code class=\"cs\">@addTagHelper &quot;*, Microsoft.AspNet.Mvc.TagHelpers&quot; <\/code><\/pre>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u044b \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430, \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0443 <b>@addTagHelper<\/b> \u0432 \u0444\u0430\u0439\u043b Views\/_ViewImports.cshtml.<\/p>\n<h2>Link \u0438 Script<\/h2>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0438\u0437 \u0438\u0445 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0439, \u044d\u0442\u0438 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u044b \u0441\u043e\u0437\u0434\u0430\u043d\u044b \u0434\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0442\u0435\u0433\u043e\u0432 <b>link<\/b> \u0438 <b>script<\/b> \u0432 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0435\u043c\u0443\u044e HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441 \u0438\u0445 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043c\u043e\u0436\u043d\u043e \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0441\u0441\u044b\u043b\u043e\u043a \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0444\u0430\u0439\u043b\u043e\u0432 \u0432 \u0434\u0435\u0432\u0435\u043b\u043e\u043f\u043c\u0435\u043d\u0442 \u0441\u0440\u0435\u0434\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 CDN \u0441 \u043e\u0442\u043a\u0430\u0442\u043e\u043c \u043d\u0430 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0438 \u0438\u043d\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u043a\u0435\u0448\u0430. <br \/>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0432\u0441\u0435 js \u0444\u0430\u0439\u043b\u044b \u0432 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0435 (\u0440\u0438\u0441\u0443\u043d\u043e\u043a 1).<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/19c\/cae\/16c\/19ccae16caed4b17a1726eb1154a10b7.png\" alt=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 1\"\/><\/p>\n<p>  \u041c\u044b \u043c\u043e\u0436\u0435\u043c \u044d\u0442\u043e \u043b\u0435\u0433\u043a\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0430 Script, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432\u0441\u0435 \u0444\u0430\u0439\u043b\u044b \u043f\u043e \u0448\u0430\u0431\u043b\u043e\u043d\u0443:  <\/p>\n<pre><code class=\"html\">&lt;script asp-src-include=&quot;~\/app\/**\/*.js&quot;&gt;&lt;\/script&gt; <\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430:  <\/p>\n<pre><code class=\"html\">&lt;script src=&quot;\/app\/app.js&quot;&gt;&lt;\/script&gt; &lt;script src=&quot;\/app\/controllers\/controller1.js&quot;&gt;&lt;\/script&gt; &lt;script src=&quot;\/app\/controllers\/controller2.js&quot;&gt;&lt;\/script&gt; &lt;script src=&quot;\/app\/controllers\/controller3.js&quot;&gt;&lt;\/script&gt; &lt;script src=&quot;\/app\/controllers\/controller4.js&quot;&gt;&lt;\/script&gt; &lt;script src=&quot;\/app\/services\/service1.js&quot;&gt;&lt;\/script&gt; &lt;script src=&quot;\/app\/services\/service2.js&quot;&gt;&lt;\/script&gt; <\/code><\/pre>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0448\u0430\u0431\u043b\u043e\u043d <b>\/app\/**\/*.js<\/b>, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0435\u0449\u0435 \u0438 js \u0444\u0430\u0439\u043b\u044b \u0438\u0437 \u043f\u043e\u0434\u043f\u0430\u043f\u043e\u043a. \u0415\u0441\u043b\u0438 \u0436\u0435 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 \u0432\u0441\u0435 js \u0444\u0430\u0439\u043b\u044b \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u043f\u0430\u043f\u043a\u0438, \u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0448\u0430\u0431\u043b\u043e\u043d <b>\/app\/*.js<\/b>.<br \/>  \u041d\u0430\u0440\u044f\u0434\u0443 \u0441 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c <i>asp-src-include<\/i> \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <i>asp-src-exclude<\/i>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0441\u0441\u044b\u043b\u043a\u0438 \u043d\u0430 js \u0444\u0430\u0439\u043b\u044b \u0432 \u043f\u043e\u0434\u043f\u0430\u043f\u043a\u0435 services \u043d\u0435 \u0431\u044b\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b:  <\/p>\n<pre><code class=\"html\">&lt;script asp-src-include=&quot;~\/app\/**\/*.js&quot; asp-src-exclude=&quot;~\/app\/services\/**\/*.js&quot; &gt; &lt;\/script&gt; <\/code><\/pre>\n<p>  \u0422\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440 Link \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438 <i>asp-href-include<\/i> \u0438 <i>asp-href-exclude<\/i>.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u044d\u0442\u0438\u0445 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0443\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0442\u044c CDN. \u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f CDN \u0434\u043b\u044f \u0445\u043e\u0441\u0442\u0438\u043d\u0433\u0430 \u0444\u0430\u0439\u043b\u043e\u0432 \u0442\u0430\u043a\u0438\u0445 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0444\u0440\u0435\u0439\u043c\u0432\u043e\u0440\u043a\u043e\u0432 \u043a\u0430\u043a jQuery \u0438 Bootstrap \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u044b: \u0443\u043c\u0435\u043d\u044c\u0448\u0430\u0435\u0442\u0441\u044f \u043d\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043d\u0430 \u043d\u0430\u0448\u0438 \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0438 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0430\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u0444\u0430\u0439\u043b\u0430 \u0443\u0436\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0432 \u043a\u0435\u0448\u0435 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430 \u0443 \u043a\u043b\u0438\u0435\u043d\u0442\u0430). \u0421\u0440\u0435\u0434\u0438 \u043c\u0438\u043d\u0443\u0441\u043e\u0432 \u2013 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0442\u043e\u0433\u043e, \u0447\u0442\u043e CDN \u043d\u0435 \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c \u0444\u0430\u0439\u043b\u044b \u0441\u043e \u0441\u0432\u043e\u0435\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u043e\u0432 \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0440\u043e\u0449\u0435:  <\/p>\n<pre><code class=\"html\">&lt;link rel=&quot;stylesheet&quot; href=&quot;\/\/ajax.aspnetcdn.com\/ajax\/bootstrap\/3.0.0\/css\/bootstrap.min.css&quot;        asp-fallback-href=&quot;~\/lib\/bootstrap\/css\/bootstrap.min.css&quot;       asp-fallback-test-class=&quot;hidden&quot;        asp-fallback-test-property=&quot;visibility&quot;        asp-fallback-test-value=&quot;hidden&quot; \/&gt; &lt;script src=&quot;\/\/ajax.aspnetcdn.com\/ajax\/bootstrap\/3.0.0\/bootstrap.min.js&quot;         asp-fallback-src=&quot;~\/lib\/bootstrap\/js\/bootstrap.min.js&quot;         asp-fallback-test=&quot;window.jQuery&quot;&gt; &lt;\/script&gt; <\/code><\/pre>\n<p>  \u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b <i>asp-fallback-test<\/i> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0438\u043b\u0438 \u043e\u0431\u044a\u0435\u043a\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0443\u0437\u043d\u0430\u0442\u044c, \u0431\u044b\u043b \u043b\u0438 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u0444\u0430\u0439\u043b \u0438\u043b\u0438 \u043d\u0435\u0442. \u0415\u0441\u043b\u0438 \u043d\u0435\u0442, \u0442\u043e \u0444\u0430\u0439\u043b \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0443\u0442\u0438, \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0435 <i>asp-fallback-href<\/i>. \u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430:  <\/p>\n<pre><code class=\"html\">&lt;link rel=&quot;stylesheet&quot; href=&quot;\/\/ajax.aspnetcdn.com\/ajax\/bootstrap\/3.0.0\/css\/bootstrap.min.css&quot; \/&gt; &lt;meta name=&quot;x-stylesheet-fallback-test&quot; class=&quot;hidden&quot; \/&gt; &lt;script&gt;!function(a,b,c){var d,e=document,f=e.getElementsByTagName(&quot;SCRIPT&quot;),g=f[f.length-1].previousElementSibling,h=e.defaultView&amp;&amp;e.defaultView.getComputedStyle?e.defaultView.getComputedStyle(g):g.currentStyle;if(h&amp;&amp;h[a]!==b)for(d=0;d&lt;c.length;d++)e.write('&lt;link rel=&quot;stylesheet&quot; href=&quot;'+c[d]+'&quot;\/&gt;')}(&quot;visibility&quot;,&quot;hidden&quot;,[&quot;\\\/lib\\\/bootstrap\\\/css\\\/bootstrap.min.css&quot;]);&lt;\/script&gt;  &lt;script src=&quot;\/\/ajax.aspnetcdn.com\/ajax\/bootstrap\/3.0.0\/bootstrap.min.js&quot;&gt; &lt;\/script&gt; &lt;script&gt;(typeof($.fn.modal) === 'undefined'||document.write(&quot;&lt;script src=\\&quot;\\\/lib\\\/bootstrap\\\/js\\\/bootstrap.min.js\\&quot;&gt;&lt;\\\/script&gt;&quot;));&lt;\/script&gt; <\/code><\/pre>\n<p>  Cache busting (\u0438\u043d\u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f \u043a\u0435\u0448\u0430) \u2013 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u0432\u0435\u0440\u0441\u0438\u0438 \u0444\u0430\u0439\u043b\u0430 (\u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e) \u043a \u0438\u043c\u0435\u043d\u0438 \u0444\u0430\u0439\u043b\u0430 \u0434\u043b\u044f css \u0438 js \u0444\u0430\u0439\u043b\u043e\u0432. \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443, \u0447\u0442\u043e \u044d\u0442\u0438 \u0444\u0430\u0439\u043b\u044b \u043c\u043e\u0436\u043d\u043e \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e \u0434\u043e\u043b\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0438\u043c\u044f \u0443 \u043d\u0438\u0445 \u0442\u0430\u043a\u0436\u0435 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u0441\u044f. \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <i>asp-append-version<\/i>:  <\/p>\n<pre><code class=\"html\">&lt;link rel=&quot;stylesheet&quot; href=&quot;~\/css\/site.min.css&quot; asp-append-version=&quot;true&quot;\/&gt; <\/code><\/pre>\n<p>  \u0421\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 HTML:  <\/p>\n<pre><code class=\"html\">&lt;link rel=&quot;stylesheet&quot; href=&quot;\/css\/site.min.css?v=UdxKHVNJA5vb1EsG9O9uURFDfEE3j1E3DgwL6NiDGMc&quot; \/&gt; <\/code><\/pre>\n<h2>Environment<\/h2>\n<p>  \u0422\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440 <b>Environment<\/b> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f (\u043e\u0431\u044b\u0447\u043d\u043e \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0430\u043c\u0438 <b>Link<\/b> \u0438 <b>Script<\/b>) \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0439 HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0441\u0440\u0435\u0434\u044b: \u0434\u0435\u0432\u0435\u043b\u043e\u043f\u043c\u0435\u043d\u0442 vs \u0442\u0435\u0441\u0442 vs \u043f\u0440\u043e\u0434\u0430\u043a\u0448\u0435\u043d. \u042d\u0442\u043e\u0442 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: \u043e\u0431\u0435\u0440\u043d\u0438\u0442\u0435 \u0432 \u044d\u0442\u043e\u0442 \u0442\u0435\u0433 \u0447\u0430\u0441\u0442\u044c HTML \u043a\u043e\u0434\u0430 \u0438 \u0443\u043a\u0430\u0436\u0438\u0442\u0435 \u0441\u0440\u0435\u0434\u0443 \u0438\u043b\u0438 \u0441\u0440\u0435\u0434\u044b, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u044d\u0442\u0430 \u0447\u0430\u0441\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0430 \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0444\u0430\u0439\u043b. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0432 \u0434\u0435\u0432\u0435\u043b\u043e\u043f\u043c\u0435\u043d\u0442 \u0441\u0440\u0435\u0434\u0435 \u043c\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432\u0441\u0435 css \u0444\u0430\u0439\u043b\u044b \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0430 \u0432 \u0441\u0440\u0435\u0434\u0430\u0445 Staging \u0438 Production \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u043a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043c\u0438\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e.  <\/p>\n<pre><code class=\"html\">&lt;environment names=&quot;Development&quot;&gt;                 &lt;link rel=&quot;stylesheet&quot; href=&quot;~\/css\/site1.css&quot; \/&gt;     &lt;link rel=&quot;stylesheet&quot; href=&quot;~\/css\/site2.css&quot; \/&gt; &lt;\/environment&gt; &lt;environment names=&quot;Staging,Production&quot;&gt;     &lt;link rel=&quot;stylesheet&quot; href=&quot;~\/css\/site.min.css&quot; asp-file-version=&quot;true&quot;\/&gt; &lt;\/environment&gt; <\/code><\/pre>\n<p>  \u0412 \u0434\u0435\u0432\u0435\u043b\u043e\u043f\u043c\u0435\u043d\u0442 \u0441\u0440\u0435\u0434\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 HTML \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"html\">&lt;link rel=&quot;stylesheet&quot; href=&quot;\/css\/site1.css&quot; \/&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;\/css\/site2.css&quot; \/&gt; <\/code><\/pre>\n<p>  \u0412 \u0441\u0440\u0435\u0434\u0430\u0445 Staging \u0438 Production \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043c\u0438\u043d\u0438\u0444\u0438\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e:  <\/p>\n<pre><code class=\"html\">&lt;link rel=&quot;stylesheet&quot; href=&quot;\/css\/site.min.css?v=UdxKHVNJA5vb1EsG9O9uURFDfEE3j1E3DgwL6NiDGMc&quot;\/&gt; <\/code><\/pre>\n<p>  \u0421\u0430\u043c \u0442\u0435\u0433 <b>environment<\/b> \u043d\u0435 \u043f\u043e\u0441\u044b\u043b\u0430\u0435\u0442\u0441\u044f \u043a\u043b\u0438\u0435\u043d\u0442\u0443. \u0415\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439 <b>Hosting:Environment<\/b>. \u0412 ASP.NET Core 1.0 (MVC 6) <b>Hosting:Environment<\/b> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0442\u0435\u0445 \u0436\u0435 \u0446\u0435\u043b\u0435\u0439, \u0434\u043b\u044f \u043a\u0430\u043a\u0438\u0445 \u0440\u0430\u043d\u044c\u0448\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0430\u0441\u044c Debug \/ Release \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u044f. \u041e\u0431\u044b\u0447\u043d\u043e <b>Hosting:Environment<\/b> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f: Development, Staging \u0438 Production. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0441\u0430\u0439\u0442\u0430 \u0438\u0437 Visual Studio \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f Development. \u0412 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0443\u0431\u0435\u0434\u0438\u0442\u044c\u0441\u044f, \u043e\u0442\u043a\u0440\u044b\u0432 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 MVC \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432 Visual Studio (\u0440\u0438\u0441\u0443\u043d\u043e\u043a 2).<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/142\/f54\/3f4\/142f543f4e6148d388673a6b0580d68f.png\" alt=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 2\"\/><\/p>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0440\u0435\u0434\u044b Staging \u0438\u043b\u0438 Production, \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u043e\u0442\u043b\u0430\u0434\u043a\u0438 (Debug Profile) \u0438 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 <b>Hosting:Environment<\/b>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u0440\u043e\u0444\u0438\u043b\u044c Production (\u0440\u0438\u0441\u0443\u043d\u043e\u043a 3).  <\/p>\n<ul>\n<li>\u041a\u043b\u0438\u043a\u043d\u0443\u0442\u044c \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u043e\u0439 \u043c\u044b\u0448\u0438 \u043f\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0443 \u0432 \u043e\u0431\u043e\u0437\u0440\u0435\u0432\u0430\u0442\u0435\u043b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0438 \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0421\u0432\u043e\u0439\u0441\u0442\u0432\u0430.<\/li>\n<li>\u0412\u044b\u0431\u0440\u0430\u0442\u044c \u0432\u043a\u043b\u0430\u0434\u043a\u0443 Debug (\u041e\u0442\u043b\u0430\u0434\u043a\u0430).<\/li>\n<li>\u041d\u0430\u0436\u043c\u0438\u0442\u0435 New\u2026 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0444\u0438\u043b\u044f \u0438 \u043d\u0430\u0437\u043e\u0432\u0438\u0442\u0435 \u0435\u0433\u043e \u201cIIS Express \u2013 Prod\u201d.<\/li>\n<li>\u0412 \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0435 Launch \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u201cIIS Express\u201d.<\/li>\n<li>\u0414\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043d\u043e\u0432\u0443\u044e \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0441 \u0438\u043c\u0435\u043d\u0435\u043c \u201cHosting:Environment\u201d \u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c \u201cProduction\u201d.<\/li>\n<li>\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0435 \u043f\u0440\u043e\u0435\u043a\u0442.<\/li>\n<\/ul>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/51e\/850\/c0c\/51e850c0c5eb489c910445b2abcdebc9.png\" alt=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 3\"\/><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u043c \u0441\u043f\u0438\u0441\u043a\u0435 Run \u0432 Visual Studio \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0444\u0438\u043b\u044c \u201cIIS Express \u2013 Prod\u201d (\u0440\u0438\u0441\u0443\u043d\u043e\u043a 4).<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/208\/a1a\/f76\/208a1af766644f6991a4492fabebb5c4.png\" alt=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 4\"\/><\/p>\n<h2>Form<\/h2>\n<p>  \u0418\u043c\u0435\u043d\u043d\u043e \u0432 \u044d\u0442\u043e\u043c \u0440\u0430\u0437\u0434\u0435\u043b\u0435 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u044b \u0434\u0435\u043b\u0430\u044e\u0442 \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443 \u043b\u0443\u0447\u0448\u0435 \u0432\u0441\u0435\u0433\u043e, \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044f \u0447\u0438\u0442\u0430\u0435\u043c\u043e\u0441\u0442\u044c \u0438 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0443 cshtml \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0439. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u043b\u043e\u0433\u0438\u043d \u0444\u043e\u0440\u043c\u0443 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u044c\u044e:  <\/p>\n<pre><code class=\"cs\">public class LoginViewModel {     public string UserName { get; set; }     public string Password { get; set; } } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 \u0434\u043b\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 UserName.  <\/p>\n<pre><code class=\"html\">&lt;!--\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Html Helper (MVC 5 \u0438 \u043d\u0438\u0436\u0435)--&gt; @Html.EditorFor(l =&gt; l.UserName) &lt;!--\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Tag Helper (MVC 6)--&gt; &lt;input asp-for=&quot;UserName&quot; \/&gt; <\/code><\/pre>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c HTML \u0445\u044d\u043b\u043f\u0435\u0440, \u0442\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043e\u0431\u044b\u0447\u043d\u044b\u0439 C# \u043c\u0435\u0442\u043e\u0434, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0443\u044e HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443. \u0421 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0430\u043c\u0438 \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0434\u0435\u043b\u043e \u0441\u0440\u0430\u0437\u0443 \u0441 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u043e\u0439, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u044e\u0442\u0441\u044f MVC \u0441\u043f\u0435\u0446\u0438\u0444\u0438\u0447\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b. \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043e\u0431\u043e\u0438\u0445 \u043f\u043e\u0434\u0445\u043e\u0434\u043e\u0432 \u043d\u0430 \u0432\u044b\u0445\u043e\u0434\u0435 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043e\u0434\u0438\u043d \u0438 \u0442\u043e\u0442 \u0436\u0435 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 HTML \u043a\u043e\u0434:   <\/p>\n<pre><code class=\"html\">&lt;input name=&quot;UserName&quot; class=&quot;text-box single-line&quot; id=&quot;UserName&quot; type=&quot;text&quot; value=&quot;&quot;&gt; <\/code><\/pre>\n<p>  \u041f\u043e\u0447\u0435\u043c\u0443 \u043f\u043e\u0434\u0445\u043e\u0434 \u0441 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0430\u043c\u0438 \u043b\u0443\u0447\u0448\u0435? \u041a\u043e\u0434 \u0441 \u043d\u0438\u043c\u0438 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0447\u0438\u0442\u0430\u0435\u043c\u0435\u0435 \u0438 \u043f\u0440\u043e\u0449\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043a \u043f\u043e\u043b\u044e \u0432\u0432\u043e\u0434\u0430 \u043a\u043b\u0430\u0441\u0441:  <\/p>\n<pre><code class=\"html\">&lt;!--\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Html Helper (MVC 5 \u0438 \u043d\u0438\u0436\u0435)--&gt; @Html.EditorFor(l =&gt; l.UserName, new { htmlAttributes = new { @class = &quot;form-control&quot; } }) &lt;!--\u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Tag Helper (MVC 6)--&gt; &lt;input asp-for=&quot;UserName&quot; class=&quot;form-control&quot; \/&gt; <\/code><\/pre>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u0434 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u043e\u0432 \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u043e \u0432\u044b\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442 \u0438 \u0432 \u043a\u0440\u0430\u0441\u043e\u0442\u0435, \u0438 \u0432 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0435.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u043a\u043e\u0434 \u0432\u0441\u0435\u0439 \u0444\u043e\u0440\u043c\u044b \u043b\u043e\u0433\u0438\u043d\u0430 \u0432 \u0434\u0432\u0443\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0430\u0445.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u0444\u043e\u0440\u043c\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 HTML Helpers<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"html\">@using (Html.BeginForm(&quot;Login&quot;, &quot;Account&quot;, new { ReturnUrl = ViewBag.ReturnUrl }, FormMethod.Post, new { role = &quot;form&quot; })) {     @Html.AntiForgeryToken()     @Html.ValidationSummary(true, &quot;&quot;, new { @class = &quot;text-danger&quot; })      &lt;div class=&quot;form-group&quot;&gt;         &lt;div class=&quot;row&quot;&gt;             @Html.LabelFor(m =&gt; m.UserName, new { @class = &quot;col-md-2 control-label&quot; })             &lt;div class=&quot;col-md-10&quot;&gt;                 @Html.TextBoxFor(m =&gt; m.UserName, new { @class = &quot;form-control&quot; })                 @Html.ValidationMessageFor(m =&gt; m.UserName, &quot;&quot;, new { @class = &quot;text-danger&quot; })             &lt;\/div&gt;         &lt;\/div&gt;     &lt;\/div&gt;     &lt;div class=&quot;form-group&quot;&gt;         &lt;div class=&quot;row&quot;&gt;             @Html.LabelFor(m =&gt; m.Password, new { @class = &quot;col-md-2 control-label&quot; })             &lt;div class=&quot;col-md-10&quot;&gt;                 @Html.PasswordFor(m =&gt; m.Password, new { @class = &quot;form-control&quot; })                 @Html.ValidationMessageFor(m =&gt; m.Password, &quot;&quot;, new { @class = &quot;text-danger&quot; })             &lt;\/div&gt;         &lt;\/div&gt;     &lt;\/div&gt;     &lt;div class=&quot;form-group&quot;&gt;         &lt;div class=&quot;row&quot;&gt;             &lt;div class=&quot;col-md-offset-2 col-md-2&quot;&gt;                 &lt;input type=&quot;submit&quot; value=&quot;Log in&quot; class=&quot;btn btn-primary&quot; \/&gt;             &lt;\/div&gt;         &lt;\/div&gt;     &lt;\/div&gt; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0422\u0430 \u0436\u0435 \u0441\u0430\u043c\u0430\u044f \u0444\u043e\u0440\u043c\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u043e\u0432<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"html\">&lt;form asp-controller=&quot;Account&quot; asp-action=&quot;Login&quot; asp-route-returnurl=&quot;@ViewBag.ReturnUrl&quot; method=&quot;post&quot; class=&quot;form-horizontal&quot; role=&quot;form&quot;&gt;     &lt;div asp-validation-summary=&quot;ValidationSummary.All&quot; class=&quot;text-danger&quot;&gt;&lt;\/div&gt;     &lt;div class=&quot;form-group&quot;&gt;         &lt;label asp-for=&quot;UserName&quot; class=&quot;col-md-2 control-label&quot;&gt;&lt;\/label&gt;         &lt;div class=&quot;col-md-10&quot;&gt;             &lt;input asp-for=&quot;UserName&quot; class=&quot;form-control&quot; \/&gt;             &lt;span asp-validation-for=&quot;UserName&quot; class=&quot;text-danger&quot;&gt;&lt;\/span&gt;         &lt;\/div&gt;     &lt;\/div&gt;     &lt;div class=&quot;form-group&quot;&gt;         &lt;label asp-for=&quot;Password&quot; class=&quot;col-md-2 control-label&quot;&gt;&lt;\/label&gt;         &lt;div class=&quot;col-md-10&quot;&gt;             &lt;input asp-for=&quot;Password&quot; class=&quot;form-control&quot; \/&gt;             &lt;span asp-validation-for=&quot;Password&quot; class=&quot;text-danger&quot;&gt;&lt;\/span&gt;         &lt;\/div&gt;     &lt;\/div&gt;     &lt;div class=&quot;form-group&quot;&gt;         &lt;div class=&quot;col-md-offset-2 col-md-10&quot;&gt;             &lt;input type=&quot;submit&quot; value=&quot;Log in&quot; class=&quot;btn btn-default&quot; \/&gt;         &lt;\/div&gt;     &lt;\/div&gt; &lt;\/form&gt; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u0432\u0435\u0440\u0441\u0438\u044f \u0441 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0430\u043c\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u043e\u0449\u0435 \u0438 \u0447\u0438\u0442\u0430\u0435\u043c\u0435\u0435. \u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043c\u043d\u0435 \u043d\u0440\u0430\u0432\u0438\u0442\u0441\u044f \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f <b>using<\/b> \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0444\u043e\u0440\u043c\u044b, \u043c\u043d\u0435 \u0432\u0441\u0435\u0433\u0434\u0430 \u044d\u0442\u043e \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u043a\u0430\u043a\u0438\u043c-\u0442\u043e \u0445\u0430\u043a\u043e\u043c. \u0415\u0449\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u043c \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u044f\u0432\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c AntiForgeryToken \u043d\u0430 \u0444\u043e\u0440\u043c\u0443. \u0422\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440 <b>form<\/b> \u0434\u0435\u043b\u0430\u0435\u0442 \u044d\u0442\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0435\u0441\u043b\u0438 \u043d\u0435 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u044d\u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c asp-anti-forgery=\u201dfalse\u201d.<br \/>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e, Visual Studio \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u044b, \u0447\u0442\u043e\u0431\u044b \u0438\u0445 \u043b\u0435\u0433\u043a\u043e \u043c\u043e\u0436\u043d\u043e \u0431\u044b\u043b\u043e \u043e\u0442\u043b\u0438\u0447\u0438\u0442\u044c \u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 HTML \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 (\u0440\u0438\u0441\u0443\u043d\u043e\u043a 5):<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/259\/76b\/987\/25976b9876c443719b3e9854ff401d83.png\" alt=\"\u0420\u0438\u0441\u0443\u043d\u043e\u043a 5\"\/><\/p>\n<p>  \u0412\u043d\u0443\u0442\u0440\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 <i>asp-for<\/i> \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 IntelliSense, \u043f\u043e\u0434\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0438\u0439 \u0438\u043c\u0435\u043d\u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043c\u043e\u0434\u0435\u043b\u0438 (\u0440\u0438\u0441\u0443\u043d\u043e\u043a 6).<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/809\/94d\/12f\/80994d12f0574bcba579b7df0b60c454.png\" alt=\"image\"\/><\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0430 <b>form<\/b>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0432\u044f\u0437\u0430\u0442\u044c \u0444\u043e\u0440\u043c\u0443 \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b <i>asp-controller<\/i> \u0438 <i>asp-action<\/i>:   <\/p>\n<pre><code class=\"html\">&lt;form asp-controller=&quot;Account&quot;        asp-action=&quot;Login&quot;&gt; \/\/\u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0444\u043e\u0440\u043c\u044b &lt;\/form&gt; <\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430:  <\/p>\n<pre><code class=\"html\">&lt;form action=&quot;\/Account\/Login&quot; method=&quot;post&quot;&gt; \/\/\u042d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0444\u043e\u0440\u043c\u044b     &lt;input name=&quot;__RequestVerificationToken&quot; type=&quot;hidden&quot; value=&quot;CfDJ8AFtmUdx-b5MkQvAyGYbjFmMGSMv0Fmk7gG4RqGXlkNV6yqKqj6fgqnOh4TLT6ZnWSaqtAbKkgpEB20lvfkc2iOKZKIqt3tJ4Jij8DjmatTrZo-DKVOLwwOzj3kB8VKpFwc0rQMjaJTTC_gVv5f0vAg&quot;&gt; &lt;\/form&gt; <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f AntiForgeryKey, \u0430 \u043c\u0435\u0442\u043e\u0434\u0443 \u0444\u043e\u0440\u043c\u044b \u043f\u0440\u0438\u0441\u0432\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 POST. \u042d\u0442\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0432 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <i>method<\/i>. \u0412\u0441\u0435 HTML \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443, \u043f\u043e\u043f\u0430\u0434\u0443\u0442 \u0432 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434. \u041e\u0434\u043d\u0430\u043a\u043e \u0441\u0442\u043e\u0438\u0442 \u0443\u0447\u0435\u0441\u0442\u044c, \u0447\u0442\u043e \u043d\u0435\u043b\u044c\u0437\u044f \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e \u0437\u0430\u0434\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <i>action<\/i> \u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 <i>asp-controller<\/i> \/ <i>asp-action<\/i>, \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435: \u00abCannot override the \u2018action\u2019 attribute for . A  with a specified \u2018action\u2019 must not have attributes starting with \u2018asp-route-\u2018 or an \u2018asp-action\u2019 or \u2018asp-controller\u2019 attribute.\u00bb<br \/>  \u0418\u043d\u043e\u0433\u0434\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0441 <i>asp-route-<\/i>. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 Login \u0447\u0430\u0441\u0442\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 ReturnUrl, \u0432\u043e\u0442 \u043a\u0430\u043a \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u043e\u0432:  <\/p>\n<pre><code class=\"html\">&lt;form asp-controller=&quot;Account&quot;        asp-action=&quot;Login&quot;        asp-route-returnurl=&quot;@ViewBag.ReturnUrl&quot;        method=&quot;post&quot; &gt; &lt;\/form&gt; <\/code><\/pre>\n<p>  \u0412 \u0438\u0442\u043e\u0433\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d \u0442\u0430\u043a\u043e\u0439 HTML \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"html\">&lt;form action=&quot;\/Account\/Login?returnurl=%2FHome%2FAbout&quot; method=&quot;post&quot;&gt;     &lt;input name=&quot;__RequestVerificationToken&quot; type=&quot;hidden&quot; value=&quot;CfDJ8AFtmUdx-b5MkQvAyGYbjFmMGSMv0Fmk7gG4RqGXlkNV6yqKqj6fgqnOh4TLT6ZnWSaqtAbKkgpEB20lvfkc2iOKZKIqt3tJ4Jij8DjmatTrZo-DKVOLwwOzj3kB8VKpFwc0rQMjaJTTC_gVv5f0vAg&quot;&gt; &lt;\/form&gt; <\/code><\/pre>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441, \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0441\u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e.<br \/>  \u0415\u0449\u0435 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440 <b>form<\/b> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0432\u043c\u0435\u0441\u0442\u043e \u043f\u0430\u0440\u044b \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440 \/ \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435. \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u043c\u044b \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u043b\u0438 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0441 \u0438\u043c\u0435\u043d\u0435\u043c <b>login<\/b> \u0432 MVC \u043a\u043e\u0434\u0435:  <\/p>\n<pre><code class=\"cs\">routes.MapRoute(     name: &quot;login&quot;,     template: &quot;login&quot;,     defaults: new { controller = &quot;Account&quot;, action = &quot;Login&quot; }); <\/code><\/pre>\n<p>  \u0422\u043e\u0433\u0434\u0430 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 \u0434\u043b\u044f \u0444\u043e\u0440\u043c\u044b, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <i>asp-route<\/i>:  <\/p>\n<pre><code class=\"html\">&lt;form asp-route=&quot;login&quot;        asp-route-returnurl=&quot;@ViewBag.ReturnUrl&quot;        method=&quot;post&quot; &gt; &lt;\/form&gt; <\/code><\/pre>\n<p>  \u0427\u0442\u043e \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a\u0443\u044e \u0436\u0435 HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443, \u043a\u0430\u043a \u0438 \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435:  <\/p>\n<pre><code class=\"html\">&lt;form action=&quot;\/login?returnurl=%2FHome%2FAbout&quot; method=&quot;post&quot;&gt;     &lt;input name=&quot;__RequestVerificationToken&quot; type=&quot;hidden&quot; value=&quot;CfDJ8AFtmUdx-b5MkQvAyGYbjFmMGSMv0Fmk7gG4RqGXlkNV6yqKqj6fgqnOh4TLT6ZnWSaqtAbKkgpEB20lvfkc2iOKZKIqt3tJ4Jij8DjmatTrZo-DKVOLwwOzj3kB8VKpFwc0rQMjaJTTC_gVv5f0vAg&quot;&gt; &lt;\/form&gt; <\/code><\/pre>\n<h2>Input<\/h2>\n<p>  \u0422\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440 <b>input<\/b> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043e\u0439  <a href=\"https:\/\/habrahabr.ru\/users\/html\/\" class=\"user_link\">Html<\/a>.EditorFor. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u0430\u043a\u043e\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 \u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"cs\">public class SimpleViewModel {    public string Email { get; set; } } <\/code><\/pre>\n<p>  \u041f\u043e\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 \u0434\u043b\u044f Email \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <i>asp-for<\/i> \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430:  <\/p>\n<pre><code class=\"html\">&lt;input asp-for=&quot;Email&quot; \/&gt; <\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443:  <\/p>\n<pre><code class=\"html\">&lt;input type=&quot;text&quot; id=&quot;Email&quot; name=&quot;Email&quot; value=&quot;thisaddress@isfrommymodel.com&quot; \/&gt; <\/code><\/pre>\n<p>  \u0422\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b <i>id<\/i> \u0438 <i>name<\/i>, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0438\u043c\u0435\u043d\u0435\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u043c \u0432 <i>asp-for<\/i>. \u0422\u0438\u043f \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e input \u0431\u044b\u043b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d \u0432 text \u043f\u043e\u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0442\u0438\u043f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 Email string. \u0415\u0441\u043b\u0438 \u0431\u044b \u0442\u0438\u043f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0431\u044b\u043b bool, \u0442\u043e \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u0431\u044b input \u0441 \u0442\u0438\u043f\u043e\u043c checkbox. \u041d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f .NET \u0442\u0438\u043f\u043e\u0432 \u0438 HTML input \u0442\u0438\u043f\u043e\u0432.  <\/p>\n<table>\n<tr>\n<td><i>.NET \u0442\u0438\u043f<\/i><\/td>\n<td><i>HTML input \u0442\u0438\u043f<\/i><\/td>\n<\/tr>\n<tr>\n<td>String<\/td>\n<td>type=\u201dtext\u201d<\/td>\n<\/tr>\n<tr>\n<td>DateTime<\/td>\n<td>type=\u201ddatetime\u201d<\/td>\n<\/tr>\n<tr>\n<td>Byte<\/td>\n<td>type=\u201dnumber\u201d<\/td>\n<\/tr>\n<tr>\n<td>Int16, Int32, Int64<\/td>\n<td>type=\u201dnumber\u201d<\/td>\n<\/tr>\n<tr>\n<td>Single, Double<\/td>\n<td>type=\u201dnumber\u201d<\/td>\n<\/tr>\n<tr>\n<td>Boolean<\/td>\n<td>type=\u201dcheckbox\u201d<\/td>\n<\/tr>\n<\/table>\n<p>  \u0422\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440 <b>input<\/b> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0432\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0442\u0438\u043f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u043d\u043e \u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0434\u043e\u0431\u0430\u0432\u0438\u043c <b>[Required]<\/b> \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 Email:  <\/p>\n<pre><code class=\"cs\">public class SimpleViewModel {   [Required]    public string Email { get; set; } } <\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0432 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <i>data-val-required<\/i>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f jQuery Validation.  <\/p>\n<pre><code class=\"html\">&lt;input type=&quot;text&quot; data-val=&quot;true&quot;                     data-val-required=&quot;The Email field is required.&quot;                     id=&quot;Email&quot;                     name=&quot;Email&quot;                     value=&quot;&quot; \/&gt; <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <b>[EmailAddress]<\/b> \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 \u043c\u043e\u0434\u0435\u043b\u0438, \u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d input \u0441 \u0442\u0438\u043f\u043e\u043c email \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c <i>data-val-email<\/i>. \u041d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0430 \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u0435\u043c .NET \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c \u0442\u0438\u043f\u0430\u043c HTML input.   <\/p>\n<table>\n<tr>\n<td><i>\u0410\u0442\u0440\u0438\u0431\u0443\u0442<\/i><\/td>\n<td><i>HTML input \u0442\u0438\u043f<\/i><\/td>\n<\/tr>\n<tr>\n<td>[EmailAddress]<\/td>\n<td>type=\u201demail\u201d<\/td>\n<\/tr>\n<tr>\n<td>[Url]<\/td>\n<td>type=\u201durl\u201d<\/td>\n<\/tr>\n<tr>\n<td>[HiddenInput]<\/td>\n<td>type=\u201dhidden\u201d<\/td>\n<\/tr>\n<tr>\n<td>[DataType(DataType.Password)]<\/td>\n<td>type=\u201dpassword\u201d<\/td>\n<\/tr>\n<tr>\n<td>[DataType(DataType.Date)]<\/td>\n<td>type=\u201ddate\u201d<\/td>\n<\/tr>\n<tr>\n<td>[DataType(DataType.Time)]<\/td>\n<td>type=\u201dtime\u201d<\/td>\n<\/tr>\n<\/table>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043e\u0447\u0435\u0440\u043d\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0432 \u043c\u043e\u0434\u0435\u043b\u044f\u0445 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0427\u0443\u0442\u044c \u0443\u0441\u043b\u043e\u0436\u043d\u0438\u043c \u043d\u0430\u0448\u0443 \u043c\u043e\u0434\u0435\u043b\u044c.  <\/p>\n<pre><code class=\"cs\">public class AddressViewModel {     public string AddressLine1 { get; set; } }  public class RegisterViewModel {     public string UserName { get; set;}     public AddressViewModel Address { get; set; } } <\/code><\/pre>\n<p>  \u0412 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u043b\u0435 \u0432\u0432\u043e\u0434\u0430 \u0434\u043b\u044f Address.AddressLine1:  <\/p>\n<pre><code class=\"html\">&lt;input asp-for=&quot;Address.AddressLine1&quot; \/&gt; <\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 HTML \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"html\">&lt;input name=&quot;Address.AddressLine1&quot; id=&quot;Address_AddressLine1&quot; type=&quot;text&quot; value=&quot;&quot;&gt; <\/code><\/pre>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u0441\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0432 cshtml \u0444\u0430\u0439\u043b\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u044b \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0443 <b>input<\/b>, \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0432 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443.<br \/>  \u0415\u0449\u0435 \u043e\u0434\u043d\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e, \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0439 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u043e\u043c <b>input<\/b>, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u044b\u0447\u043d\u043e\u0439 &lt;a href=\u201d <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/dwhawy9k.aspx\">msdn.microsoft.com\/en-us\/library\/dwhawy9k.aspx<\/a>\u201d&gt;\u0441\u0442\u0440\u043e\u043a\u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f, \u0448\u0438\u0440\u043e\u043a\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0435\u0439\u0441\u044f \u0432 .NET. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <i>asp-format<\/i>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"html\">&lt;input asp-for=&quot;SomeNumber&quot; asp-format=&quot;{0:N4}&quot;\/&gt; <\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0447\u0438\u0441\u043b\u043e \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0441 4 \u0437\u043d\u0430\u043a\u0430\u043c\u0438 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u044f\u0442\u043e\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 1.2000. \u041d\u0438\u043a\u0430\u043a\u0438\u0445 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f.<br \/>  \u041a\u0430\u043a \u043c\u044b \u0443\u0436\u0435 \u0433\u043e\u0432\u043e\u0440\u0438\u043b\u0438, Visual Studio \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 IntelliSense \u0434\u043b\u044f \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0430 <b>input<\/b>, \u043f\u043e\u0434\u0441\u0432\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0438, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 \u0438\u043c\u0435\u043d\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430. \u0418\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u043e\u0448\u0435\u043d\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u0438, \u043d\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e Razor \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u043d\u0435 \u043f\u0440\u0435\u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u044e\u0442\u0441\u044f, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u044d\u0442\u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u0438\u0434\u043d\u0430 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0438 \u043f\u0435\u0440\u0432\u043e\u043c \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u0438 \u043a \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435.<\/p>\n<h2>TextArea<\/h2>\n<p>  \u0422\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440 <b>textarea<\/b> \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 \u0440\u0430\u043d\u0435\u0435 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0439 <b>input<\/b> \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043e\u0439  <a href=\"https:\/\/habrahabr.ru\/users\/html\/\" class=\"user_link\">Html<\/a>.TextAreaFor. \u041e\u043d \u0442\u0430\u043a\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <i>asp-for<\/i>. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"cs\">public class SimpleViewModel {     [Required]     [MaxLength(5000)]     public string Description { get; set; } } <\/code><\/pre>\n<p>  \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440 <b>textarea<\/b> \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<pre><code class=\"html\">&lt;textarea asp-for=&quot;Description&quot;&gt;&lt;\/textarea&gt; <\/code><\/pre>\n<p>  \u0427\u0442\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443:  <\/p>\n<pre><code class=\"html\">&lt;textarea name=&quot;Description&quot; id=&quot;Description&quot;            data-val-required=&quot;The Description field is required.&quot;            data-val-maxlength-max=&quot;5000&quot;            data-val-maxlength=&quot;The field Description must be a string or array type with a maximum length of '5000'.&quot;            data-val=&quot;true&quot;&gt;&lt;\/textarea&gt; <\/code><\/pre>\n<p>  \u0412 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435 textarea \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b name, id, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b.<\/p>\n<h2>Validation<\/h2>\n<p>  \u041c\u044b \u0443\u0432\u0438\u0434\u0435\u043b\u0438, \u0447\u0442\u043e \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043d\u0435\u0441\u043b\u043e\u0436\u043d\u043e, \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u0431\u0441\u0443\u0434\u0438\u043c, \u0433\u0434\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f. \u0420\u0430\u043d\u044c\u0448\u0435 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043c\u0435\u0442\u043e\u0434  <a href=\"https:\/\/habrahabr.ru\/users\/html\/\" class=\"user_link\">Html<\/a>.ValidationMessageFor, \u0442\u0435\u043f\u0435\u0440\u044c \u2013 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <i>asp-validation-for<\/i>, \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u043c\u044b\u0439 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 span.  <\/p>\n<pre><code class=\"html\">&lt;span asp-validation-for=&quot;Email&quot;&gt;&lt;\/span&gt; <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u043f\u043e\u043b\u0435 Email \u0431\u044b\u043b\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c, \u043d\u043e \u043d\u0435 \u0431\u044b\u043b\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043e:  <\/p>\n<pre><code class=\"html\">&lt;span class=&quot;field-validation-error&quot;           data-valmsg-replace=&quot;true&quot;           data-valmsg-for=&quot;Email&quot;&gt;     The Email field is required.&lt;\/span&gt; <\/code><\/pre>\n<p>  \u0422\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440 \u043d\u0430\u0448\u0435\u043b \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 Email \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043b \u0435\u0433\u043e \u0432 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 span. \u0422\u0430\u043a\u0436\u0435 \u043e\u043d \u0434\u043e\u0431\u0430\u0432\u0438\u043b <i>data-valmsg-*<\/i> \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u0447\u0442\u043e\u0431\u044b \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u0430\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044f jQuery \u0434\u043b\u044f \u043f\u043e\u043b\u044f Email \u0440\u0430\u0431\u043e\u0442\u0430\u043b\u0430 \u0441 \u044d\u0442\u0438\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c. \u041e\u0431\u044b\u0447\u043d\u043e \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043c\u0435\u0449\u0435\u043d \u043d\u0430 \u0444\u043e\u0440\u043c\u0443 \u0440\u044f\u0434\u043e\u043c \u0441 \u043f\u043e\u043b\u0435\u043c, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043e\u043d \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u0442. \u041a\u0430\u043a \u0438 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u043e\u0432, \u0432\u0441\u0435 HTML \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b \u043a \u043d\u0435\u043c\u0443 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u0435, \u043f\u043e\u043f\u0430\u0434\u0443\u0442 \u0432 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443.<br \/>  \u0422\u0435\u043f\u0435\u0440\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0430\u043d\u0430\u043b\u043e\u0433  <a href=\"https:\/\/habrahabr.ru\/users\/html\/\" class=\"user_link\">Html<\/a>.ValidationSummary(true) \u2013 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440 <b>Validation Summary<\/b>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u0443\u0435\u0442 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0443\u0440\u043e\u0432\u043d\u044f \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438\/\u0438\u043b\u0438 \u0443\u0440\u043e\u0432\u043d\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u043c\u043e\u0434\u0435\u043b\u0438. \u042d\u0442\u043e\u0442 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <i>asp-validation-summary<\/i>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0443 div. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430:  <\/p>\n<ul>\n<li>ValidationSummary.All \u2013 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0443\u0440\u043e\u0432\u043d\u044f \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438, \u0438 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0435\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432.<\/li>\n<li>ValidationSummary.ModelOnly \u2013 \u0431\u0443\u0434\u0443\u0442 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u044b \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u0443\u0440\u043e\u0432\u043d\u044f \u0432\u0441\u0435\u0439 \u043c\u043e\u0434\u0435\u043b\u0438<\/li>\n<li>ValidationSummary.None \u2013 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0434\u0435\u043b\u0430\u0435\u0442, \u043a\u0430\u043a \u0435\u0441\u043b\u0438 \u0431\u044b \u0432\u044b \u043d\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u043b\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <i>asp-validation-summary<\/i>. \u0415\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0435\u043c \u0432\u0438\u0434\u0438\u0442\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u043e\u0435 \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0432\u0441\u0435\u0445 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u0441\u0432\u043e\u0438\u0445 \u0434\u0435\u0432\u0435\u043b\u043e\u043f\u0435\u0440\u0441\u043a\u0438\u0445 \u043d\u0443\u0436\u0434.<\/li>\n<\/ul>\n<p>  <\/p>\n<pre><code class=\"html\">&lt;div asp-validation-summary=&quot;ValidationSummary.All&quot;&gt;&lt;\/div&gt; <\/code><\/pre>\n<p>  \u042d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u043a\u043e\u0433\u0434\u0430 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043e\u043a \u043d\u0435\u0442:  <\/p>\n<pre><code class=\"html\">&lt;div class=&quot;validation-summary-valid&quot; data-valmsg-summary=&quot;true&quot;&gt;   &lt;ul&gt;     &lt;li style=&quot;display: none;&quot;&gt;&lt;\/li&gt;   &lt;\/ul&gt; &lt;\/div&gt; <\/code><\/pre>\n<p>  \u0415\u0441\u043b\u0438 \u0436\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043e\u0448\u0438\u0431\u043a\u0438 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438:  <\/p>\n<pre><code class=\"html\">&lt;div class=&quot;validation-summary-errors&quot; data-valmsg-summary=&quot;true&quot;&gt;   &lt;ul&gt;     &lt;li&gt;The Email field is required.&lt;\/li&gt;     &lt;li&gt;The Password field is required.&lt;\/li&gt;   &lt;\/ul&gt; &lt;\/div&gt; <\/code><\/pre>\n<h2>Label<\/h2>\n<p>  \u0422\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440 <b>label<\/b> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u044b\u043c <strike>\u0441\u043a\u0443\u0447\u043d\u044b\u043c<\/strike> \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u043e\u043c, \u0437\u0430\u043c\u0435\u043d\u043e\u0439  <a href=\"https:\/\/habrahabr.ru\/users\/html\/\" class=\"user_link\">Html<\/a>.LabelFor. \u0415\u0433\u043e \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u0437\u0430\u0434\u0430\u0447\u0430 \u2013 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442 label \u0434\u043b\u044f \u043f\u043e\u043b\u044f, \u0438\u043c\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0435 <i>asp-for<\/i>. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u044d\u0442\u043e\u0433\u043e label \u0437\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c Name \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <b>Description<\/b>. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0442\u0430\u043a\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"cs\">public class SimpleViewModel {     [Display(Name=&quot;Email Address&quot;)]     public string Email { get; set; } } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440 <b>label<\/b>:  <\/p>\n<pre><code class=\"html\">&lt;label asp-for=&quot;Email&quot;&gt;&lt;\/label&gt; <\/code><\/pre>\n<p>  \u0427\u0442\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0434\u0430\u0441\u0442 \u043d\u0430\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443:  <\/p>\n<pre><code class=\"html\">&lt;label for=&quot;Email&quot;&gt;Email Address&lt;\/label&gt; <\/code><\/pre>\n<h2>Select<\/h2>\n<p>  \u0422\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440 <b>select<\/b> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u0441\u043f\u0438\u0441\u043a\u043e\u0432 \u0432 HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0435 \u0432\u043c\u0435\u0441\u0442\u043e  <a href=\"https:\/\/habrahabr.ru\/users\/html\/\" class=\"user_link\">Html<\/a>.DropDownListFor. \u041f\u0443\u0441\u0442\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043c\u043e\u0434\u0435\u043b\u044c \u0441\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c CountryCode, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u0433\u043e \u0441\u043f\u0438\u0441\u043a\u0430:  <\/p>\n<pre><code class=\"cs\">public class SimpleViewModel {     public string CountryCode { get; set; } } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0430 \u0441\u0432\u044f\u0436\u0435\u043c \u044d\u0442\u043e \u043f\u043e\u043b\u0435 \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c select.  <\/p>\n<pre><code class=\"html\">&lt;select asp-for=&quot;CountryCode&quot;&gt;&lt;\/select&gt; <\/code><\/pre>\n<p>  \u0418 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 HTML \u043a\u043e\u0434:  <\/p>\n<pre><code class=\"html\">&lt;select name=&quot;CountryCode&quot; id=&quot;CountryCode&quot;&gt; &lt;\/select&gt; <\/code><\/pre>\n<p>  \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0435 \u043d\u0435\u0441\u0435\u0442 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0446\u0435\u043d\u043d\u043e\u0441\u0442\u0438, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0435\u0449\u0435 \u043f\u0443\u0441\u0442. \u0415\u0441\u0442\u044c 2 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0435\u0433\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c. \u041f\u0435\u0440\u0432\u044b\u0439 (\u0434\u043b\u044f \u0441\u043e\u0432\u0441\u0435\u043c \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u0438\u0445 \u0441\u043f\u0438\u0441\u043a\u043e\u0432): \u0432\u0441\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0437\u0430\u0434\u0430\u0442\u044c \u0432\u0440\u0443\u0447\u043d\u0443\u044e \u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438:  <\/p>\n<pre><code class=\"html\">&lt;select asp-for=&quot;CountryCode&quot;&gt;     &lt;option value=&quot;CA&quot;&gt;Canada&lt;\/option&gt;     &lt;option value=&quot;US&quot;&gt;US&lt;\/option&gt;     &lt;option value=&quot;--&quot;&gt;Other&lt;\/option&gt; &lt;\/select&gt; <\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0431\u0440\u0430\u043d\u043e \u0438\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 CountryCode \u0440\u0430\u0432\u0435\u043d \u201cCA\u201d, \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0430\u044f HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430:  <\/p>\n<pre><code class=\"html\">&lt;select name=&quot;CountryCode&quot; id=&quot;CountryCode&quot;&gt;     &lt;option selected=&quot;selected&quot; value=&quot;CA&quot;&gt;Canada&lt;\/option&gt;     &lt;option value=&quot;US&quot;&gt;US&lt;\/option&gt;     &lt;option value=&quot;--&quot;&gt;Other&lt;\/option&gt; &lt;\/select&gt; <\/code><\/pre>\n<p>  \u0412\u0442\u043e\u0440\u043e\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u2013 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0438\u0437 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u0435\u043d \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a \u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u0438\u043f\u0430 <i>IEnumerable&lt;SelectListItem&gt;<\/i> (\u0438\u043b\u0438 <i>SelectList<\/i>), \u043f\u0443\u0441\u0442\u044c \u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 ViewBag.Countries. \u0414\u043b\u044f \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442 <i>asp-items<\/i>:  <\/p>\n<pre><code class=\"html\">&lt;select asp-for=&quot;CountryCode&quot;           asp-items=&quot;ViewBag.Countries&quot;&gt; &lt;\/select&gt; <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 select \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0431\u043e\u0440\u0430 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u043c\u043e\u0434\u0435\u043b\u0438 \u0438\u043c\u0435\u043b\u043e \u0442\u0438\u043f IEnumerable, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"cs\">public class SimpleViewModel {     public IEnumerable&lt;string&gt; CountryCodes { get; set; } } <\/code><\/pre>\n<p>  \u0412 \u043a\u043e\u0434\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0430 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043c\u0435\u043d\u044f\u0435\u043c:  <\/p>\n<pre><code class=\"html\">&lt;select asp-for=&quot;CountryCodes&quot;          asp-items=&quot;ViewBag.Countries&quot;&gt; &lt;\/select&gt; <\/code><\/pre>\n<p>  \u041d\u043e \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 \u0431\u0443\u0434\u0435\u0442 \u0434\u0440\u0443\u0433\u043e\u0439:  <\/p>\n<pre><code class=\"html\">&lt;select name=&quot;CountryCodes&quot;          id=&quot;CountryCodes&quot;          multiple=&quot;multiple&quot;&gt;     &lt;option selected=&quot;selected&quot;              value=&quot;CA&quot;&gt;Canada&lt;\/option&gt;     &lt;option value=&quot;USA&quot;&gt;United States&lt;\/option&gt;     &lt;option value=&quot;--&quot;&gt;Other&lt;\/option&gt; &lt;\/select&gt; <\/code><\/pre>\n<p>  <\/p>\n<h2>Anchor<\/h2>\n<p>  \u0422\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440 <b>anchor<\/b> \u0441\u043b\u0443\u0436\u0438\u0442 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0441\u044b\u043b\u043e\u043a \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0437\u0430\u043c\u0435\u043d\u043e\u0439 \u043a\u0430\u043a  <a href=\"https:\/\/habrahabr.ru\/users\/html\/\" class=\"user_link\">Html<\/a>.ActionLink, \u0442\u0430\u043a \u0438  <a href=\"https:\/\/habrahabr.ru\/users\/url\/\" class=\"user_link\">Url<\/a>.Action, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043c\u044b \u043e\u0431\u044b\u0447\u043d\u043e \u043f\u0438\u0441\u0430\u043b\u0438 \u0432\u043e\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"html\">@Html.ActionLink(&quot;Register&quot;, &quot;Register&quot;, &quot;Account&quot;)  &lt;a href=&quot;@Url.Action(&quot;Register&quot;, &quot;Account&quot;)&quot;&gt;Register&lt;\/a&gt; <\/code><\/pre>\n<p>  \u0418 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u043b\u0438 \u0434\u0432\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0441\u0441\u044b\u043b\u043a\u0438:  <\/p>\n<pre><code class=\"html\">&lt;a href=&quot;\/Account\/Register&quot;&gt;Register&lt;\/a&gt; &lt;a href=&quot;\/Account\/Register&quot;&gt;Register&lt;\/a&gt; <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0430 <b>anchor<\/b> \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 <i>asp-controller<\/i>, <i>asp-action<\/i> \u0441\u0441\u044b\u043b\u043a\u0443 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  <\/p>\n<pre><code class=\"html\">&lt;a asp-controller=&quot;Account&quot;      asp-action=&quot;Register&quot;&gt;Register&lt;\/a&gt; <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u043e\u0432, \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0449\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043a\u043b\u0430\u0441\u0441\u044b \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0432 \u043e\u0442\u043b\u0438\u0447\u0438\u0435 \u043e\u0442  <a href=\"https:\/\/habrahabr.ru\/users\/html\/\" class=\"user_link\">Html<\/a>.ActionLink(\u00abRegister \u00bb, \u00abCreate\u00bb, \u201cAccount\u201d, null, new {  <a href=\"https:\/\/habrahabr.ru\/users\/class\/\" class=\"user_link\">class<\/a>= \u00abcss-class\u00bb} ).<br \/>  \u0415\u0441\u043b\u0438 \u0432 \u043c\u0435\u0442\u043e\u0434 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u0430 \u043d\u0430\u0434\u043e \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0442\u043e \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0438 \u0434\u043b\u044f \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0430 <b>form<\/b>: \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 <i> asp-route-*<\/i>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440:  <\/p>\n<pre><code class=\"html\">&lt;a asp-controller=&quot;Product&quot;     asp-action=&quot;Display&quot;     asp-route-id=&quot;@ViewBag.ProductId&quot;&gt; View Details&lt;\/a&gt; <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0440\u0448\u0440\u0443\u0442 (\u043e\u043f\u044f\u0442\u044c \u0442\u043e\u0447\u043d\u043e \u0442\u0430\u043a \u0436\u0435, \u043a\u0430\u043a \u0434\u043b\u044f <b>form<\/b>):  <\/p>\n<pre><code class=\"html\">&lt;a asp-route=&quot;login&quot;&gt;Login&lt;\/a&gt; <\/code><\/pre>\n<p>  \u0420\u0430\u043d\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0439  <a href=\"https:\/\/habrahabr.ru\/users\/html\/\" class=\"user_link\">Html<\/a>.ActionLink \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u043b \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b, \u0445\u043e\u0441\u0442 \u0438 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e URL. \u0423 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0430 \u0435\u0441\u0442\u044c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u0432\u043e\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b:  <\/p>\n<pre><code class=\"html\">&lt;a asp-controller=&quot;Account&quot;     asp-action=&quot;Register&quot;     asp-protocol=&quot;https&quot;     asp-host=&quot;asepecificdomain.com&quot;     asp-fragment=&quot;fragment&quot;&gt;Register&lt;\/a&gt;  &lt;!-- \u0438\u043b\u0438 \u0442\u043e\u043b\u044c\u043a\u043e \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044f \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b --&gt; &lt;a asp-controller=&quot;Account&quot;     asp-action=&quot;Register&quot;     asp-protocol=&quot;https&quot;&gt;Register&lt;\/a&gt; <\/code><\/pre>\n<h2>Cache<\/h2>\n<p>  \u0423 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0430 <b>cache<\/b> \u043d\u0435\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0430 \u0441\u0440\u0435\u0434\u0438  <a href=\"https:\/\/habrahabr.ru\/users\/html\/\" class=\"user_link\">Html<\/a> \u0445\u044d\u043b\u043f\u0435\u0440\u043e\u0432, \u0434\u0430 \u0438 \u043e\u0431\u044b\u0447\u043d\u044b\u043c HTML \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u043c \u043e\u043d \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438. \u041f\u0435\u0440\u0435\u0434 \u043a\u0430\u0436\u0434\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439 \u0441\u0432\u043e\u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043e\u043d \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u0442, \u043d\u0435 \u0431\u044b\u043b\u043e \u043b\u0438 \u043e\u043d\u043e \u0443\u0436\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043e \u0432 MemoryCache. \u0415\u0441\u043b\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043d\u0430\u0439\u0434\u0435\u043d\u043e \u0432 \u043a\u0435\u0448\u0435, \u043e\u043d\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0440\u0430\u0437\u0443 \u0432 Razor \u0434\u0432\u0438\u0436\u043e\u043a, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 \u2013 \u0441\u043d\u0430\u0447\u0430\u043b\u0430 Razor \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0435\u0433\u043e, \u0430 \u043f\u043e\u0442\u043e\u043c \u043e\u043d\u043e \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u043a\u0435\u0448. \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0439 ID \u0441\u0432\u043e\u0435\u0433\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e. \u0412\u043e\u0442 \u0442\u0430\u043a \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f\u0445:  <\/p>\n<pre><code class=\"html\">&lt;cache expires-after=&quot;@TimeSpan.FromMinutes(10)&quot;&gt;     @Html.Partial(&quot;_WhatsNew&quot;)     *last updated  @DateTime.Now.ToLongTimeString() &lt;\/cache&gt; <\/code><\/pre>\n<p>  \u0422\u0435\u0433 <i>cache<\/i> \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0435\u043d \u0432 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0443, \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0438\u0440\u0435\u043a\u0442\u0438\u0432\u0430 \u0434\u043b\u044f \u0434\u0432\u0438\u0436\u043a\u0430, \u0447\u0442\u043e \u043d\u0430 \u043f\u0440\u043e\u0442\u044f\u0436\u0435\u043d\u0438\u0438 10 \u043c\u0438\u043d\u0443\u0442 \u043a\u043b\u0438\u0435\u043d\u0442\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u044b\u043b\u0430\u0442\u044c \u0443\u0436\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u043d\u043d\u0443\u044e \u0438 \u0437\u0430\u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f _WhatsNew. <br \/>  \u0415\u0441\u043b\u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0436\u0438\u0437\u043d\u0438 \u0437\u0430\u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0438, \u0442\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043e\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c\u0441\u044f \u0432\u0441\u0435 \u0432\u0440\u0435\u043c\u044f \u0436\u0438\u0437\u043d\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f (\u0438\u043b\u0438 \u0434\u043e \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0440\u0435\u0441\u0430\u0439\u043a\u043b\u0430 \u043f\u0443\u043b\u0430). \u0422\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440 <b>cache<\/b> \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u043f\u0446\u0438\u0438 \u0437\u0430\u0434\u0430\u043d\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0436\u0438\u0437\u043d\u0438 \u0437\u0430\u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430:  <\/p>\n<ol>\n<li><i>expires-after<\/i>: \u0437\u0430\u0434\u0430\u0435\u0442 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043c\u043e\u043c\u0435\u043d\u0442\u0430, \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u0435\u0448 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, 5 \u0441\u0435\u043a\u0443\u043d\u0434. \u0410\u0442\u0440\u0438\u0431\u0443\u0442 <i>expires-after<\/i> \u043e\u0436\u0438\u0434\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 TimeSpan:<br \/> \n<pre><code class=\"html\">&lt;cache expires-after=&quot;@TimeSpan.FromSeconds(5)&quot;&gt;     &lt;!-- \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 --&gt;     *last updated  @DateTime.Now.ToLongTimeString() &lt;\/cache&gt; <\/code><\/pre>\n<p>   <\/li>\n<li><i>expires-on<\/i>: \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 DateTime, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u0432 \u043a\u0430\u043a\u043e\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043a\u0435\u0448 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u043d\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u043c:<br \/> \n<pre><code class=\"html\">&lt;cache expires-on=&quot;@DateTime.Today.AddDays(1).AddTicks(-1)&quot;&gt;   &lt;!--\u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435--&gt;  *last updated  @DateTime.Now.ToLongTimeString() &lt;\/cache&gt; <\/code><\/pre>\n<p>   <\/li>\n<li><i>expires-sliding<\/i>: \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 \u0442\u0438\u043f\u0430 TimeSpan, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u0434\u0430\u0435\u0442 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u043a \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0435\u0441\u043b\u0438 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442 \u0432 \u043a\u0435\u0448\u0435 \u043d\u0435 \u0437\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u043b\u0441\u044f, \u0442\u043e \u043a\u0435\u0448 \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0435\u0442 \u0431\u044b\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u043c.<br \/> \n<pre><code class=\"html\">&lt;cache expires-sliding=&quot;@TimeSpan.FromMinutes(5)&quot;&gt;     &lt;!-- \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 --&gt;     *last updated  @DateTime.Now.ToLongTimeString() &lt;\/cache&gt; <\/code><\/pre>\n<p>   <\/li>\n<\/ol>\n<p>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u043a\u043b\u044e\u0447 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u043a\u0435\u0448\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0443\u043d\u0438\u043a\u0430\u043b\u044c\u043d\u043e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0430 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0430, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u043e\u0432 <b>cache<\/b> \u043d\u0430 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 \u0431\u0435\u0437 \u043f\u0443\u0442\u0430\u043d\u0438\u0446\u044b \u0438\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u0432 \u043a\u0435\u0448\u0435. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 <i>vary-by<\/i> \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u0434\u0430\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0438\u0435 \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0430 <b>cache<\/b> \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u044b\u0445 \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u044b \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 <i>vary-by<\/i>.  <\/p>\n<ol>\n<li><i>vary-by-user<\/i>: \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0431\u0443\u043b\u0435\u0432\u0441\u043a\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0437\u0430\u043b\u043e\u0433\u0438\u043d\u0435\u043d\u043d\u044b\u0445 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439. \u041a \u043a\u043b\u044e\u0447\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u043a\u0435\u0448\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0438\u043c\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f.<br \/> \n<pre><code class=\"html\">&lt;cache vary-by-user=&quot;true&quot;&gt;      &lt;!-- \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 --&gt;      *last updated @DateTime.Now.ToLongTimeString()  &lt;\/cache&gt; <\/code><\/pre>\n<p>  <\/li>\n<li><i>vary-by-route<\/i>: \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u043c\u0435\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u043a \u043a\u043b\u044e\u0447\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <i>id<\/i>:<br \/> \n<pre><code class=\"html\">&lt;cache vary-by-route=&quot;id&quot;&gt;     &lt;!-- \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 --&gt;     *last updated  @DateTime.Now.ToLongTimeString() &lt;\/cache&gt; <\/code><\/pre>\n<p>  <\/li>\n<li><i>vary-by-query<\/i>: \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0438\u043c\u0435\u043d \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0431\u0443\u0434\u0443\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u044b \u043a \u043a\u043b\u044e\u0447\u0443 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0432 \u043a\u0435\u0448\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 <i>search<\/i>:<br \/> \n<pre><code class=\"html\">&lt;cache vary-by-query=&quot;search&quot;&gt;     &lt;!-- \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 --&gt;     *last updated  @DateTime.Now.ToLongTimeString() &lt;\/cache&gt; <\/code><\/pre>\n<p>  <\/li>\n<li><i>vary-by-header<\/i>: \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0438\u043c\u044f HTTP \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 (\u043e\u0434\u043d\u043e, \u043d\u0435 \u0441\u043f\u0438\u0441\u043e\u043a), \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043e \u043a \u043a\u043b\u044e\u0447\u0443. \u0412\u043e\u0442 \u0442\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 <i>User-Agent<\/i>:<br \/> \n<pre><code class=\"html\">&lt;cache vary-by-header=&quot;User-Agent&quot;&gt;     &lt;!-- \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 --&gt;     *last updated  @DateTime.Now.ToLongTimeString() &lt;\/cache&gt; <\/code><\/pre>\n<p>  <\/li>\n<li><i>vary-by<\/i>: \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0430 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u0435\u0441\u043b\u0438 \u043d\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u043d\u044b\u0445 \u0432\u044b\u0448\u0435 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 <i>vary-by-*<\/i> \u043d\u0435 \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e ProductId, \u0445\u0440\u0430\u043d\u044f\u0449\u0435\u0435\u0441\u044f \u0432\u043e ViewBag:<br \/> \n<pre><code class=\"html\">&lt;cache vary-by=&quot;@ViewBag.ProductId&quot;&gt;     &lt;!-- \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 --&gt;     *last updated  @DateTime.Now.ToLongTimeString() &lt;\/cache&gt; <\/code><\/pre>\n<p>  <\/li>\n<li>\u0421\u043e\u0441\u0442\u0430\u0432\u043d\u044b\u0435 \u043a\u043b\u044e\u0447\u0438: \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c \u0441\u0440\u0430\u0437\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 <i>vary-by<\/i>, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0438 \u043f\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e, \u0438 \u043f\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0443 \u043c\u0430\u0440\u0448\u0440\u0443\u0442\u0438\u0437\u0430\u0446\u0438\u0438 id:<br \/> \n<pre><code class=\"html\">&lt;cache vary-by-user=&quot;true&quot; vary-by-route=&quot;id&quot;&gt;     &lt;!-- \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 --&gt;     *last updated  @DateTime.Now.ToLongTimeString() &lt;\/cache&gt; <\/code><\/pre>\n<p>  <\/li>\n<\/ol>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u0432\u0441\u0435 \u0437\u0430\u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 <i>IMemoryCache<\/i>, \u0442\u043e \u0435\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u043b\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442 \u0438\u0441\u043f\u044b\u0442\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u0445\u0432\u0430\u0442\u043a\u0443 \u043f\u0430\u043c\u044f\u0442\u0438, \u043a\u0435\u0448 \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0441\u0432\u043e\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u043e\u0441\u0432\u043e\u0431\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u043f\u0430\u043c\u044f\u0442\u0438. \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <i>priority<\/i> \u043c\u043e\u0436\u043d\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u043e\u0431\u044a\u0435\u043a\u0442\u044b \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u043c\u0438, \u0430 \u043a\u0430\u043a\u0438\u0435 \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0442\u044c \u0432 \u043a\u0435\u0448\u0435. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430: Low, Normal, High \u0438 NeverRemove. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443\u043a\u0430\u0436\u0435\u043c, \u0447\u0442\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043d\u0435\u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442\u043d\u044b\u043c:  <\/p>\n<pre><code class=\"html\">@using Microsoft.Framework.Caching.Memory &lt;cache vary-by-user=&quot;true&quot;         priority=&quot;@CachePreservationPriority.Low&quot;&gt;     &lt;!-- \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 --&gt;     *last updated  @DateTime.Now.ToLongTimeString() &lt;\/cache&gt;<\/code><\/pre>\n<p>  \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0433\u043e \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0430 \u0441\u0432\u044f\u0437\u0430\u043d\u044b \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 MemoryCache \u0432 \u0441\u0432\u043e\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u041f\u0435\u0440\u0432\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043b\u044e\u0431\u043e\u0439 \u043f\u0435\u0440\u0435\u0437\u0430\u043f\u0443\u0441\u043a \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0430, \u0440\u0435\u0441\u0430\u0439\u043a\u043b \u043f\u0443\u043b\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u043f\u043e\u0445\u043e\u0436\u0435\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0438\u043d\u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u0442 \u0432\u0435\u0441\u044c \u043d\u0430\u0448 \u043a\u0435\u0448, \u0432 \u043e\u0431\u043b\u0430\u043a\u0435 \u0442\u0430\u043a\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0442\u0438, \u0435\u0441\u043b\u0438 \u0441\u0430\u0439\u0442 \u043f\u0435\u0440\u0435\u0435\u0434\u0435\u0442 \u043d\u0430 \u043d\u043e\u0432\u0443\u044e \u043c\u0430\u0448\u0438\u043d\u0443. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0435\u043b\u044c\u0437\u044f \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u0435\u0448 \u043d\u0430\u0434\u0435\u0436\u043d\u044b\u043c. \u0412\u0442\u043e\u0440\u043e\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u0436\u0435 \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u043a\u0435\u0448 \u0445\u0440\u0430\u043d\u0438\u0442\u0441\u044f \u0432 \u043f\u0430\u043c\u044f\u0442\u0438. \u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0441\u0435\u0441\u0441\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0435\u0440\u0435\u043d\u0430\u043f\u0440\u0430\u0432\u043b\u0435\u043d \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0435 \u0432\u0435\u0431-\u0441\u0435\u0440\u0432\u0435\u0440\u0430, \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043e\u043d \u043c\u043e\u0436\u0435\u0442 \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u0440\u0430\u0437\u043d\u043e\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0438 \u0442\u043e\u0433\u043e \u0436\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430. \u042d\u0442\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043e \u0441 \u0442\u0435\u043c, \u0447\u0442\u043e \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0435\u0440\u0432\u0435\u0440\u0430 \u0431\u0443\u0434\u0435\u0442 \u0441\u0432\u043e\u044f \u0432\u0435\u0440\u0441\u0438\u044f \u043a\u0435\u0448\u0430, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f MemoryCache \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043c\u043e\u0447\u044c \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043a \u043e\u0434\u043d\u043e\u043c\u0443 \u0438 \u0442\u043e\u043c\u0443 \u0436\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0443 (sticky session, server affinity).<\/p>\n<h2>Image<\/h2>\n<p>  \u042d\u0442\u043e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u043e\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <i>asp-append-version<\/i>, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u043e\u0433\u043e \u043a \u0442\u0435\u0433\u0443 <b>img<\/b>. \u0415\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u044d\u0442\u043e\u043c\u0443 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0443 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 true, \u0442\u043e \u043a URL \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0430\u044f \u043e\u0442 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u043c\u043e\u0433\u043e \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0438 (\u043a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 css \/ js \u0444\u0430\u0439\u043b\u043e\u0432), \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0443 \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0435\u0435 \u043d\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e \u0434\u043e\u043b\u0433\u043e\u0435 \u0432\u0440\u0435\u043c\u044f.   <\/p>\n<pre><code class=\"html\">&lt;img src=&quot;~\/images\/logo.png&quot;       alt=&quot;company logo&quot;       asp-append-version=&quot;true&quot; \/&gt; <\/code><\/pre>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043f\u043e\u0445\u043e\u0436\u0430\u044f HTML \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430:  <\/p>\n<pre><code class=\"html\">&lt;img src=&quot;\/images\/logo.png?v=W2F5D366_nQ2fQqUk3URdgWy2ZekXjHzHJaY5yaiOOk&quot;       alt=&quot;company logo&quot;\/&gt; <\/code><\/pre>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0430 \u0443\u043f\u0440\u043e\u0449\u0430\u0435\u0442 \u0432\u044b\u0431\u043e\u0440 \u043f\u043e\u043b\u0438\u0442\u0438\u043a\u0438 \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0441\u0430\u0439\u0442\u0430: \u043f\u0440\u0438 \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043d\u0438\u0432\u0435\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u044b\u0433\u043e\u0434\u0430 \u043e\u0442 \u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f, \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u2013 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u043a\u043b\u0438\u0435\u043d\u0442 \u0432 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0433\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u0440\u0443\u044e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u043a\u0435\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0421 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b \u043f\u043b\u043e\u0445\u043e, \u0447\u0442\u043e \u0432\u0441\u0435 \u043d\u0430\u0448\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 MVC &lt;= 5 \u043d\u0430\u0434\u043e \u043f\u0435\u0440\u0435\u043f\u0438\u0441\u044b\u0432\u0430\u0442\u044c, \u043d\u043e \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u043e\u0432 \u043e\u043d\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u0447\u0438\u0449\u0435, \u0438\u0445 \u043b\u0435\u0433\u0447\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440\u0430\u043c \/ \u0432\u0435\u0440\u0441\u0442\u0430\u043b\u044c\u0449\u0438\u043a\u0430\u043c, \u0442\u0435\u043f\u0435\u0440\u044c \u043e\u043d\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0439 HTML \u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438. \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0430\u0437 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0435\u0433\u043e \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0430, \u0430 \u043f\u043e\u043a\u0430 \u043a\u0430\u0447\u0430\u0439\u0442\u0435 VS 2015 Community Edition, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0441\u0432\u043e\u0439 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442 ASP.NET Core 1.0!<\/p>\n<h3>\u0421\u0441\u044b\u043b\u043a\u0438<\/h3>\n<p>  <a href=\"http:\/\/docs.asp.net\/projects\/mvc\/en\/latest\/views\/tag-helpers\/intro.html\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u043e \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0430\u043c<\/a><br \/>  <a href=\"http:\/\/docs.asp.net\/projects\/mvc\/en\/latest\/index.html\">\u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u043f\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0432\u0435\u0440\u0441\u0438\u0438 ASP.NET MVC<\/a><br \/>  <a href=\"https:\/\/www.visualstudio.com\/ru-ru\/products\/visual-studio-community-vs.aspx\">Visual Studio 2015 Community Edition<\/a>       <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/276277\/\"> https:\/\/habrahabr.ru\/post\/276277\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0422\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u044b (Tag Helpers) \u2013 \u043d\u043e\u0432\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f MVC, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 HTML \u043a\u043e\u0434\u0430. \u041e\u043d\u0438 \u0432\u044b\u0433\u043b\u044f\u0434\u044f\u0442 \u043a\u0430\u043a \u043e\u0431\u044b\u0447\u043d\u044b\u0435 HTML \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0432\u0438\u0436\u043a\u043e\u043c Razor \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0441\u0435\u0440\u0432\u0435\u0440\u0430. \u0422\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u044b \u0432\u043e \u043c\u043d\u043e\u0433\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441 \u0434\u043b\u044f HTML Helpers, \u043d\u043e \u0442\u0430\u043a\u0436\u0435 \u043e\u043d\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e, \u0447\u0442\u043e \u0431\u044b\u043b\u043e \u0442\u0440\u0443\u0434\u043d\u043e \u0438\u043b\u0438 \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e HTML Helpers. \u0423 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u0430 \u0441\u0432\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438. \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u0442 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u0442\u0435\u0433-\u0445\u044d\u043b\u043f\u0435\u0440\u044b, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0432 MVC 6 (ASP .NET Core 1.0, \u043a\u0430\u043a \u0441\u0442\u0430\u043b\u043e \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e \u0441\u043e\u0432\u0441\u0435\u043c \u043d\u0435\u0434\u0430\u0432\u043d\u043e).  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-273353","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/273353","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=273353"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/273353\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=273353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=273353"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=273353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}