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# (37,933 stars) (10,653 forks)batch import
affected-fewarea-mvcbughelp wantedseverity-major

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

make Partial Tag Helper's "view-data" attribute helperful · dotnet/aspnetcore#9736 | Good First Issue