Why is my Model object always null on my Razor Page in dotnet core 2.x Razor Page app? : <p>I'm creating a Partial View as a part of my Index.cshtml.
I am following the basics outlined in the Microsoft article => <a href="https://docs.microsoft.com/en-us/aspnet/core/mvc/views/partial?view=aspnetcore-2.1" rel="noreferrer">https://docs.microsoft.com/en-us/aspnet/core/mvc/views/partial?view=aspnetcore-2.1</a></p>

<p>The summary of it is that I'm :
Adding a span to my Index.cshtml file which is actually loaded with the HTML from a Razor Page. 
The relevant HTML in Index.cshtml looks like the following:</p>

<pre><code>&lt;span id="basicView"&gt;
    @{ 
        Model.UserName = "IndexUser";
        await Html.RenderPartialAsync("BasicPartial", Model);
    }
&lt;/span&gt;
</code></pre>

<p>I have added public property to my IndexModel named UserName in the RazorPage and it looks like the following:</p>

<pre><code>namespace FirstCore.Pages
{
    public class IndexModel : PageModel
    {

        public string UserName;
        public void OnGet()
        {

        }
    }
}
</code></pre>

<p>It is kept very simple for this example.
So, in the HTML in the Index.cshtml you can see that I set the value of that public property to "IndexUser" and then I pass the name of the Razor Page ("BasicPartial" - View) and the Model object to the BasicaPartial Razor Page.</p>

<p>The BasicPartial page is very simple -- was generated from the Visual Studio 2017 template - Add...Razor Page...  The entire things looks like:</p>

<pre><code>@page
@model IndexModel
@*
    For more information on enabling MVC for empty projects, visit http://go.microsoft.com/fwlink/?LinkID=397860
*@
&lt;div&gt;This is the text and the user name is @(Model.UserName).&lt;/div&gt;
</code></pre>

<p>Actually, the only important part is the  and the place where I'm reading the property value of UserName out of the passed in Model.
You can see I've also defined the @model as an IndexModel at the top.</p>

<p><strong>The Main Problem - Model is ALWAYS Null</strong></p>

<p>When I run this very simple example.  The application tells me that the Model object is null.</p>

<p><a href="https://i.stack.imgur.com/MPEcm.png" rel="noreferrer"><img src="https://i.stack.imgur.com/MPEcm.png" alt="Model is null"></a></p>

<p>You may believe that it is the UserName that is null, but if I put a very simple directive at the top like </p>

<pre><code>&lt;div&gt;@Model&lt;/div&gt; 
</code></pre>

<p>Then it tells me that Model is null, even though I know I'm passing it in.</p>

<p>Do you know why it is null?</p>
