dotnet/aspnetcore

make Partial Tag Helper's "view-data" attribute helperful

Open

#9,736 opened on Apr 25, 2019

View on GitHub
 (7 comments) (8 reactions) (0 assignees)C# (10,653 forks)batch import
affected-fewarea-mvcbughelp wantedseverity-major

Repository metrics

Stars
 (37,933 stars)
PR merge metrics
 (Avg merge 16d 9h) (258 merged PRs in 30d)

Description

<partial name="view" view-data-additionalItem="abc" /> 

The IDictionary<string,object> has a very helpful way to add item , But this line of code throw exception because view-data is null .

I suggestion to either support this razor syntax or add a new attribute to add addiontal item to the partial view and not effect the current view‘s ViewData

Contributor guide