I had a website containing a createuserwizard control. And when you create an account, an email verification along with its verification URL will be sent to the user's email address.
However, when I have a trial run, after clicking on the URL in the email, this error appears:
Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).
Source Error:
Line 17: {
Line 18:
*Line 19: Guid userId = new Guid(Request.QueryString["ID"]);*
Line 20:
Error appeared on LINE 19.
Another fun thing: the validation url in my test mode looks weird:
http:
Usually the URL should look like this (this is a lot of characters at the end of the URL:
http:
I really thought there was a link to the end of the URL with my error problem (Guid should contain 32 digits with four dashes).
The code that generates the URL is as follows:
protected void CreateUserWizard1_SendingMail(object sender,MailMessageEventArgs e)
{
string domainName = Request.Url.GetLeftPart(UriPartial.Authority) + Request.ApplicationPath;
string confirmationPage = "/Verify.aspx?ID=" + User.ToString();
string url = domainName + confirmationPage;
e.Message.Body = e.Message.Body.Replace("<%VerificationUrl%>", url);
}
Please give me suggestions and what should I do to solve these problems.
.
UPDATE:
protected void CreateUserWizard1_SendingMail(object sender,MailMessageEventArgs e)
{
MembershipUser userInfo = Membership.GetUser(CreateUserWizard1.UserName);
Guid userInfoId = (Guid)userInfo.ProviderUserKey;
string domainName = Request.Url.GetLeftPart(UriPartial.Authority) + Request.ApplicationPath;
string confirmationPage = "/Verify.aspx?ID=" + userInfo.ToString();
string url = domainName + confirmationPage;
e.Message.Body = e.Message.Body.Replace("<%VerificationUrl%>", url);
}
URL :
http:
"Guid 32 (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"