Last post Jul 20, 2015 04:22 AM by Li Wang
Jul 19, 2015 02:28 PM|dieseldave|LINK
OK - I use the create user wizard with additional fields. At the end I want to make the user get an email that they must answer in or to activate their account. I think I know how to do that. I have a column in the user table called activated which defaults
to false and is changed to true when they answer the email. The folder that contains the home page and others that can be seen by an anonymous user has links to restricted pages which can't be seen until you have logged in. However just because you are authorized
doesn't mean you have been activated. Since all of the restricted ages have the same master page I thought I could check the activated flag there, but the master page actually runs last. I should be redirecting them to a page that resends them an email,
but can I do that if he have already gone to the page? I suppose I could run the
ublic partial class Profile_profile : System.Web.UI.MasterPage
public int rid;
protected void Page_Load(object sender, EventArgs e)
HttpCookie authCookie = Request.Cookies[FormsAuthentication.FormsCookieName];
rider rd = new rider();
FormsAuthenticationTicket authTicket = FormsAuthentication.Decrypt(authCookie.Value);
rid = Convert.ToInt32(authTicket.UserData);
string uid = rd.getuseridfromrid(rid);
utility ut = new utility();
bool active = ut.isactivated(rid);
if (active == false)
This is the master page script.
code on each page but that seems overkill.
Jul 20, 2015 04:22 AM|Li Wang|LINK
Thank you for your post. You code seems work fine. But, I suggest your use role instead of activated flag. If a user registered he/she will be a member of defaultRole. After he/she answer the mail, we could change the role of he/she to registeredRole. Then
we could do security configuration according role of user.