asp.netemailconfirmation-email

Expireing active registration link in asp.net


As a user register in my website, a registration link will send him. What i want is to expire this link after 48 hours. Is there any way to do that? Thank you so much. here is my codes: In activate page:

 string userID = Request.QueryString["userID"];
   Guid gd = new Guid(userID);
   Membership.UpdateUser(user);

In activate page:

 MembershipUser user = Membership.CreateUser(TextBox_email.Text, TextBox_Pass.Text, TextBox_email.Text);

                   Roles.AddUserToRole(TextBox_email.Text, "Author");
                   user.IsApproved = false;
                   Membership.UpdateUser(user);

                   //  StringBuilder bodyMsg = new StringBuilder();

                   Guid userID = (Guid)user.ProviderUserKey;

Solution

  • I guess this is all about special querystring/route parameters in your activation link

    You can, for example :