As Title states, I would like to bind IdentityUser Properties to a hidden form input. Or perhaps I am going about the wrong way. It is tracking who creates a new project. I have access to Identity and properties.
Here is an example of my form taking in an input.
Project Target End Date:
<input type="datetime-local" @bind="projectObject.TargetEndDate">
This is an example of what id like to have happen
<input type="hidden" @bind="projectObject.CreatedBy">
(Take in IdentityUser some how here)
Here is my property binding. Project projectObject = new Project();
string CurrentUser { get; set; }
protected async override Task OnInitializedAsync()
{
var authstate = await GetAuthenticationStateAsync.GetAuthenticationStateAsync();
CurrentUser = authstate.User.Identity.Name;
}
I would like to bind CurrentUser to CreatedBy. Coding answer would appreciated, however I would like to read about the answer as well.
CurrentUser
Will display current user in component. now I am looking to bind that to the createdby property
– That Noob Programmer Feb 23 '22 at 16:12