The keys in your example are Entry2, Entry3, Entries[0], and Entries[1]. The Keys property in the following code is a comma separated list of the ModelState keys with the "Keys" key removed and Entries[0].
[BindProperties]
public class IndexModel : PageModel
{
public string?[] Entries { get; set; } = new string[2];
public string? Entry2 { get; set; }
public string? Entry3 { get; set; }
public string Keys { get; set; }
public void OnGet()
{
Entries[0] = "Entries[0]";
Entries[1] = "Entries[1]";
Entry2 = "Entry2";
Entry3 = "Entry3";
}
public void OnPost()
{
var result = ModelState.Remove(nameof(Keys));
Keys = string.Join(",", ModelState.Keys);
}
}
Markup
<form method="post">
<input asp-for="Entries[0]" />
<br />
<br />
<input asp-for="Entries[1]" />
<br />
<br />
<input asp-for="Entry2" />
<br />
<br />
<input asp-for="Entry3" />
<br />
<br />
<input type="submit" />
</form>
<div>
@Model.Keys
</div>