You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.
When indexing into an Array or List model, MvcTagHelperAttributeValueCodeRenderer generates incorrect code. For example with a List<User> model and <textarea for="[index].Blurb" /> in the Razor source, the generated C# is:
Note the extra . before [index]. This effectively limits tag helpers to simple property access.
Need to change MvcTagHelperAttributeValueCodeRenderer to leave out the . when the passed Action will write an initial [. (Can't special-case TModel to avoid breaking model => model.Count and similar expressions.) @ escaping (issue #1253) won't help without IntelliSense. Users can't see the generated code to understand the problem.
Side note: If the user is debugging or has error pages enabled, the compilation error references a line number past the end of the .cshtml file e.g.
not exact the same problem as #1253 (and #1408) but the same solution. e.g. <input asp-for="@Model[index].Blurb" /> will work once #1253 is fixed. treating this one as a duplicate...
When indexing into an
Array
orList
model,MvcTagHelperAttributeValueCodeRenderer
generates incorrect code. For example with aList<User>
model and<textarea for="[index].Blurb" />
in the Razor source, the generated C# is:Note the extra
.
before[index]
. This effectively limits tag helpers to simple property access.Need to change
MvcTagHelperAttributeValueCodeRenderer
to leave out the.
when the passedAction
will write an initial[
. (Can't special-caseTModel
to avoid breakingmodel => model.Count
and similar expressions.)@
escaping (issue #1253) won't help without IntelliSense. Users can't see the generated code to understand the problem.Side note: If the user is debugging or has error pages enabled, the compilation error references a line number past the end of the .cshtml file e.g.
In my test Index.cshtml has 37 lines.
The text was updated successfully, but these errors were encountered: