dotnet / dotnet/AspNetCore.Docs

Add fallback case - no 'model' and 'for' specified.

Open
#31,665 0 comments 0 reactions 0 assignees View on GitHub
aspnet-core/svc doc-enhancement mvc/subsvc Pri3 Source - Docs.ms
Dominant language
C#
Stars
13.1k
Forks
24.6k
Avg merge
1d 3h
Merged PRs (30d)
97

Description

### Description

Need to explain fallback case when no 'model' and 'for' attributes defined.

In source code there are two comments:
```
// 4. Fall back to using the Model property on ViewContext.ViewData if none of the above conditions are met.
...
// A value for Model or For was not specified, fallback to the ViewContext's ViewData model.
```

But in documentation this case is not explaied clearly.

### Page URL

https://learn.microsoft.com/en-us/aspnet/core/mvc/views/tag-helpers/built-in/partial-tag-helper?view=aspnetcore-8.0

### Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/mvc/views/tag-helpers/built-in/partial-tag-helper.md

### Document ID

e7df465a-5f3b-1522-b2d9-5e3afbf74257

### Article author

@Rick-Anderson

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.