I have a Blazor Server app. It uses the ASP.NET Identity Library which is MVC. I am trying to pass a parameter to login so a URL like /identity/account/Register?follow=uniqueId
gives me the parameter follow=uniqueId
.
In Register.cshtml.cs (class RegisterModel) I have:
<code>public async Task OnGetAsync(string returnUrl = null, string following = null)
{
ReturnUrl = returnUrl;
Following = following;
ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList();
}
public async Task<IActionResult> OnPostAsync(string returnUrl = null, string following = null)
{
</code>
<code>public async Task OnGetAsync(string returnUrl = null, string following = null)
{
ReturnUrl = returnUrl;
Following = following;
ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList();
}
public async Task<IActionResult> OnPostAsync(string returnUrl = null, string following = null)
{
</code>
public async Task OnGetAsync(string returnUrl = null, string following = null)
{
ReturnUrl = returnUrl;
Following = following;
ExternalLogins = (await _signInManager.GetExternalAuthenticationSchemesAsync()).ToList();
}
public async Task<IActionResult> OnPostAsync(string returnUrl = null, string following = null)
{
The value from the url is passed in to OnGetAsync()
fine. But when OnPostAsync() is called, it passes in a null for
followingand the object property
Following` is also null.
How do I get that parameter in OnPostAsync()
?