Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7071609
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:42:32+00:00 2026-05-28T05:42:32+00:00

I have a simple create user wizard and custom membership provider which was taken

  • 0

I have a simple create user wizard and custom membership provider which was taken from here

Now I am following this tutorial by scott Mitchell and creating new user using wizard and able to send email by setting Disable create property user to “False” so that whenever user recieves the activation link he needs to click that and verifies his account.

Now the problem is when he creates new user it is working fine and when he tried to login immediately he gets message that he needs to ativate the link first in order to login.

And after registration he gets email and when he clicks the link it gives me error that there is no user in the database.

As you can see below that user gets activation link
enter image description here

When the user tried to click it he gets that he is not found in the database
enter image description here

And if i check in the administration tool If I check the user is available without a tick beside it.
enter image description here

Here is my web.config:

    <?xml version="1.0"?>

<configuration>
  <connectionStrings>
    <add name="HDIConnectionString"
     connectionString="Data Source=.\SQLExpress;Integrated Security=True;User Instance=True;AttachDBFilename=|DataDirectory|HDIMembershipProvider.mdf"/>
  </connectionStrings>
  <system.web>
    <roleManager defaultProvider="CustomProvider">
      <providers>
        <add connectionStringName="HDIConnectionString" name="CustomProvider"
          type="System.Web.Security.SqlRoleProvider" />
      </providers>
    </roleManager>
    <membership defaultProvider="HDIMembershipProvider">
      <providers>
        <clear/>
        <add name="HDIMembershipProvider" type="HDI.AspNet.Membership.HDIMembershipProvider" connectionStringName="HDIConnectionString" enablePasswordRetrieval="true" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" passwordFormat="Clear"/>
      </providers>
    </membership>
    <machineKey validationKey="C50B3C89CB21F4F1422FF158A5B42D0E8DB8CB5CDA1742572A487D9401E3400267682B202B746511891C1BAF47F8D25C07F6C39A104696DB51F17C529AD3CABE" decryptionKey="8A9BE8FD67AF6979E7D20198CFEA50DD3D3799C77AF2B72F" validation="SHA1"/>
    <authentication mode="Forms">
      <forms name=".ASPXFORMSAUTH" loginUrl="Login.aspx" />
    </authentication>
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
        <add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        <add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
      </assemblies>
    </compilation>
  </system.web>
  <appSettings>
    <add key="adminEmail" value="noreply@xyz.com"/>
  </appSettings>
  <system.net>
    <mailSettings>
      <smtp from="xyz@gmail.com">
        <network host="smtp.gmail.com" password="password" port="587" userName="xyz@gmail.com"/>
      </smtp>
    </mailSettings>
  </system.net>
</configuration>

And code behind for createuser.aspx:

 Protected Sub CreateUserWizard1_SendingMail(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.MailMessageEventArgs) Handles CreateUserWizard1.SendingMail
        Dim userInfo As MembershipUser = Membership.GetUser(CreateUserWizard1.UserName)

        'Construct the verification URL
        Dim verifyUrl As String = Request.Url.GetLeftPart(UriPartial.Authority) & Page.ResolveUrl("~/Verify.aspx?ID=" & userInfo.ProviderUserKey.ToString())

        'Replace <%VerifyUrl%> placeholder with verifyUrl value
        e.Message.Body = e.Message.Body.Replace("<%VerifyUrl%>", verifyUrl)
    End Sub

Verify Page_Load:

   Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        'Make sure that a valid querystring value was passed through
        If String.IsNullOrEmpty(Request.QueryString("ID")) OrElse Not Regex.IsMatch(Request.QueryString("ID"), "[0-9a-f]{8}\-([0-9a-f]{4}\-){3}[0-9a-f]{12}") Then
            InformationLabel.Text = "An invalid ID value was passed in through the querystring."
        Else
            'ID exists and is kosher, see if this user is already approved
            'Get the ID sent in the querystring
            Dim userId As Guid = New Guid(Request.QueryString("ID"))

            'Get information about the user
            Dim userInfo As MembershipUser = Membership.GetUser(userId)
            If userInfo Is Nothing Then
                'Could not find user!
                InformationLabel.Text = "The user account could not be found in the membership database."
            Else
                'User is valid, approve them
                userInfo.IsApproved = True
                Membership.UpdateUser(userInfo)

                'Display a message
                InformationLabel.Text = "Your account has been verified and you can now log into the site."
            End If
        End If

And here is the database screenshot:
enter image description here

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T05:42:32+00:00Added an answer on May 28, 2026 at 5:42 am

    @Tim and Baldy-I have finally got working but not with UserID.I don’t know what’s wrong with the GUID and I tried it with username and it’s working perfectly.

    So if any modifications with the GUID please let me know.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple create user wizard control and It's working pretty well upto
I have used following code to create a simple PDF file. It executes fine
I have been trying to create a simple program with Python which uses OpenCV
I have an application which starts with a simple start screen allowing the user
I have simple user control with include ajax control - CalendarExtender. This is code:
I have a simple web application in which I have created a wizard, each
I am trying to create simple user registration form. I have an index.html file
I have a sample file like the following: CREATE GLOBAL TEMPORARY TABLE tt_temp_user_11 (
I have a simple PowerShell script that uses WMI to create a web site
i have very simple problem. I need to create model, that represent element of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.