If you've stumbled upon this post, it most likely means you're struggling with a nasty issue that often affects ASP.NET applications heavily based on partial views: the naming conflict between multiple HTML input elements that handle different ViewModels (or multiple instances of the same ViewModel class) having properties with the same name, when they are placed inside a Razor Page (or View) featuring multiple Razor Partial Views.In this post, we'll see how to fix this issue using the use the TemplateInfo.HtmlFieldPrefix property.The ProblemBefore presenting the solution, let's clarify the problem. Suppose we have the following Razor View:@model IEnumerable@foreach (var user in Model){ }And the following Partial View:@model UserViewModel Unique ID: Username: Email:As we can see, the first Razor Page will likely contain several Partial Views - one for each user: if we run the project and take a look at the generated HTML, we would see the following markup: Unique ID: Username: Email:






