aspnet / Mvc

[Archived] ASP.NET Core MVC is a model view controller framework for building dynamic web sites with clean separation of concerns, including the merged MVC, Web API, and Web Pages w/ Razor. Project moved to https://github.com/aspnet/AspNetCore
Apache License 2.0
5.62k stars 2.14k forks source link

HtmlFieldPrefix generated with "z_" #8709

Closed Steveiwonder closed 5 years ago

Steveiwonder commented 5 years ago

Is this a Bug or Feature request?: Bug

Steps to reproduce (preferably a link to a GitHub repo with a repro project):

Create a form

@{
    ViewData.TemplateInfo.HtmlFieldPrefx = "__Prefix";
}
<form>
<input asp-for="FirstName" />
</form>

Description of the problem:

When using any HtmlFieldPrefix that begins __ (double underscore) the output html is incorrect, it converts the first _ to z for the id only

So the above form would look like:

<form>
<input name="__FirstName" id="z_FirstName" />
</form>

I can reproduce this in a clean MVC project.

mkArtakMSFT commented 5 years ago

Thanks for contacting us, @Steveiwonder. @NTaylorMullen, can you please look into this? Thanks!

NTaylorMullen commented 5 years ago

Duplicate of https://github.com/aspnet/Mvc/issues/7859