Hey, basically im using asp.net2 with c# using ms sql 2005 database and visual studio 2005. Basically when a new user registered with my site, their account is disabled and it doesn't automatically log them in because it send them an email with a simple link inside. On the page where the link takes the user to. I have created a textbox and a button where the user types in their email address to activate their account. Their email address is not their username but a good way of triple checking that they own that email address. Well, at first i thought it was working but i actual fact it does nothing. I want the user to be approved (IsApproved=True) when they click on that button if that email address exists and they haven't already been activated. Plus the label does not show up and is set to visible.
protected void Button1_Click(object sender, EventArgs e)
{
string Email = TextBox1.Text;
MembershipUser User = Membership.GetUser(Email);
if (User !=null && User.IsApproved==false)
{
User.IsApproved=true;
Membership.UpdateUser(User);
Label2.Text="Your account is now activated";
}
}