You can pass the value as a query parameter in the form submission. a Step-by-step can be followed at -
How to pass parameters to action methods in ASP.NET Core MVC[
^]
Create a C# function that will hold, request and redirect the address value -
public class TestFormModel : PageModel
{
[BindProperty]
public string Address { get; set; }
public void OnGet()
{
Address = Request.Query["Address"];
}
public IActionResult OnPost()
{
Address = Request.Form["Address"];
return Redirect($"/TestForm?Address={Uri.EscapeDataString(Address)}");
}
}
In Razor -
<form method="post" asp-page="/TestForm" asp-route-Address="@Model.Address">
<label for="Address">Address:</label>
<input type="text" id="Address" name="Address" value="@Model.Address" />
<input type="submit" value="Submit" />
</form>