Guid should contain 32 digits with 4 dashes
<p>I had a website which contains a createuserwizard control. And upon creating an account, verification email along with its verify URL would be send to the user's email address. </p>

<p>However, when i have a test-run, upon clicking the URL in the email, this error appear: </p>

<pre><code>Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).


Source Error: 

Line 17:         {
Line 18:             //store the user id
*Line 19:             Guid userId = new Guid(Request.QueryString["ID"]);*
Line 20: 
Error appeared on LINE 19. 
</code></pre>

<p>Another funny thing is, the verification URL in my test-run look weird : </p>

<pre><code>http://localhost:4635/WebSite2/Verify.aspx?ID=System.Security.Principal.GenericPrincipal
</code></pre>

<p>Normally, the URL should like this(which is a whole lot of characters at the end of the URL: </p>

<pre><code>http://localhost:2180/LoginPage/EmailConfirmation.aspx?ID=204696d6-0255-41a7-bb0f-4d7851bf7200
</code></pre>

<p>I was actually thinking that, it there a connection with the end of the URL with my problem of the error (Guid should contain 32 digits with 4 dashes).. </p>

<p>The code that generates the URL is as follows:</p>

<pre><code>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("&lt;%VerificationUrl%&gt;", url); 
}
</code></pre>

<p>Please give me suggestions and what I should do to solve this problems. </p>

<p>Thanks in advance. </p>

<p><strong>UPDATE:</strong></p>

<pre><code>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("&lt;%VerificationUrl%&gt;", url);

}
</code></pre>

<p>Now my URL Link look like this : </p>

<pre><code>http://localhost:4635/WebSite2/Verify.aspx?ID=username
</code></pre>

<p>But the error "Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" still remained</p>
