Closed Danthar closed 3 months ago
For reference. This is the offending code.
if (additionalViewData != null)
{
foreach (KeyValuePair<string, object> kvp in TypeHelper.ObjectToDictionary(additionalViewData))
{
viewData[kvp.Key] = kvp.Value;
}
}
Thanks for contacting us.
We're not making any improvements in this area any more as this project is in maintenance mode. Only critical blocking issue with wide impact and security issues are considered.
When you use the
@Html.Editor
or any of its variants ofEditorFor
anonymous htmlattributes parameters are not translated correctly.I traced this to the
TemplateHelper
file. Namely this line of code.https://github.com/aspnet/AspNetWebStack/blob/main/src/System.Web.Mvc/Html/TemplateHelpers.cs#L308
It uses
TypeHelper.ObjectToDictionary(additionalViewData)
. Which does not translate.It should be using the
System.Web.WebPages.Html.HtmlHelper.AnonymousObjectToHtmlAttributes