In the twist, I wrote this line @Html.EditorFor(x=>x.Pass, "My") where My is a specific template stored in EditorTemplate. Pass - has a type of string. The template code itself is simple:
@model string @Html.Editor("BlaBla") - проверка запуска шаблона I expect to receive at the exit the input field and the inscription "check the launch of the template." But in return I get only an inscription. And instead of an input field - emptiness. If, of course, replace the helper with <input... > then the field will appear. The question is, why does the @Html.Editor("BlaBla") not work in the template @Html.Editor("BlaBla") all, it’s also the idea that creates an input with the name BlaBla?
upd
@model test.Models.viewmodel @{ Layout = null; } <!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <title>Index</title> </head> <body> <div> @using(Html.BeginForm()) { @Html.EditorFor(x=>x.Pass, "My")<br /> @Html.Editor("Test")<br /> <input type="submit" name="Send" /> } <br /> @Html.DisplayFor(x => x.name)<br /> @Html.DisplayFor(x => x.mail)<br /> @Html.DisplayFor(x => x.AnyNum)<br /> @Html.DisplayFor(x => x.Pass)<br /> <br /> </div> </body> </html> The viewmodel class, which is passed as a model in a view, does not contain a property named Test, but the input field is still created in a normal view using @Html.Editor("Test") . But in a template that accepts a model of the string type (which also does not contain the Test property) - already the input field @Html.Editor("Test") not created