As per the documentation, When a partial view is instantiated, it receives a copy of the parent's ViewData dictionary. Updates made to the data within the partial view aren't persisted to the parent view. ViewData changes in a partial view are lost when the partial view returns.
Checkout the documentation here
For me I have simply created a partial view, accessed it inside another view and used ViewData directly inside it.
~/Views/Shared/_PageTop.cshtml
<a asp-controller="Home" asp-action="Index">Go Back</a>
<h1>@ViewData["Title"]</h1>
~/Views/Create.cshtml
@{
ViewData["Title"] = "Create";
}
<partial name="_PageTop" />
So without passing anything to partial view _PageTop, I can access parent's Title property directly using @ViewData["Title"].