Is there a way to trigger an alert once the async method has finished executing?
This is my current implementation:
private async void SetPassword()
{
var provider = new DpapiDataProtectionProvider("RDSupport");
string userId = Support.Instance.GetUserIDDatabase(_currentUser);
UserStore<IdentityUser> userStore = new UserStore<IdentityUser>();
UserManager<IdentityUser> manager = new UserManager<IdentityUser>(userStore);
IdentityUser user = manager.FindById(userId);
manager.UserTokenProvider = new DataProtectorTokenProvider<IdentityUser, string>
(provider.Create("UserToken")) as IUserTokenProvider<IdentityUser, string>;
string token = manager.GeneratePasswordResetToken(userId);
manager.ResetPassword(userId, token, _newPassword);
string hashedNewPassword = manager.PasswordHasher.HashPassword(_newPassword);
await userStore.SetPasswordHashAsync(user, hashedNewPassword);
await userStore.UpdateAsync(user);
ScriptManager.RegisterClientScriptBlock(Page, GetType(), "myalert", "alert('Password changed successfully!');", true);
_success = true;
}
I'm currently facing an issue where the ScriptManager isn't displaying any message. Any suggestions on how to address this problem?