Skip to content
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
This repository was archived by the owner on Dec 14, 2018. It is now read-only.

Provide correct ViewDataDictionary<TModel>.ModelMetadata when Model is null #1426

@dougbu

Description

@dougbu

create views (any view where Model==null) currently have ViewData.ModelMetadata.ModelType==typeof(object) and calculated ModelMetadata for properties have metadata.ModelType==typeof(string). the problem prevents correct operation of @Html.Editor() and similar helpers. for example @Html.EditorFor(model => model.Alive) in a create view returns <input type="text" .../> though Alive is a bool property and should have <input type="checkbox" .../>.

fix here is very small. should be done in the ViewDataDictionary<TModel>.ModelMetadata getter.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions