The values are loaded then sent to the view but when I click submit the model comes back with no values. How do I resolve this?
Example View Model
public class ExampleViewModel
{
[Key]
public string? PageType { get; set; }
public int? UserId { get; set; }
public int? CurrentUserId { get; set; }
}
No.
It can be for most intents and purposes, if your view includes that information in the action that's making the next request to the server. (E.g. including these values in form fields and then posting that form to a controller action.) In that case it's still not "the same model" in the sense that it's a copy of the data being re-posted, so it's not the same object reference.
However, there is nothing which automates this for you. An empty form post, for example, will not automatically include the model that was sent to the view. That model was used to populate the view and then discarded. Whatever you do with that model to populate the view (such as setting form element values) is up to you.
It sounds like you simply haven't built some functionality that you're looking for and expecting the framework to do it automatically, which it does not.