Reputation: 527
I am trying to develop simple Registration form and login form. If a user forgot his/her password then he clicks on Forgot Password
button and a forgot password page opens where he will provide his/her email address and a password reset link is send to his/her mail address.Then he/she will click on the reset password and he will redirected to changePassword.aspx
page but i am stuck with here. When i click on reset password link i got the following error. Please find images in attachments
Here is the code for password reset
protected void SetPasswordResetEmail(string UserName, string ToEmail, string UniqueId)
{
MailMessage message = new MailMessage("[email protected]", ToEmail);
StringBuilder sbEmailBody = new StringBuilder();
sbEmailBody.Append("Dear" + UserName + ",<br/><br/>");
sbEmailBody.Append("Please click the following link to reset your password");
sbEmailBody.Append("<br/>");
sbEmailBody.Append("http://localhost/BootstrapLogin/ChangePassword.aspx?uid=" + UniqueId);
message.IsBodyHtml = true;
message.Body = sbEmailBody.ToString();
message.Subject = "Reset Your Password";
SmtpClient smtp = new SmtpClient();
smtp.Host = "smtp.gmail.com";
smtp.EnableSsl = true;
NetworkCredential NetworkCred = new NetworkCredential("[email protected]", "password");
smtp.UseDefaultCredentials = true;
smtp.Credentials = NetworkCred;
smtp.Port = 587;
smtp.Send(message);
}
Upvotes: 1
Views: 241
Reputation: 49
option 1
sbEmailBody.Append("http://localhost/BootstrapLogin/ChangePassword.aspx?uid=" + UniqueId);
// http://localhost:8080 change 8080 to your application port number
option 2
Go to your project-> properties -> Web -> Server
Then give specific port number
Upvotes: 0
Reputation: 2228
Project -> Project_name Properties... -> Web
Here you can see/change IIS port binding.
So in your url there should be this port number. Something like: http://localhost/55555/BootstrapLogin...
Upvotes: 0