Locate the userid RRS feed

  • Question

  • User546723956 posted

    for some resone which i do not know i'm not able to locate the user id that is intered in the user textbox. all that i want to do to check if the user is approved or not. 

     protected void Login1_LoggingIn(object sender, LoginCancelEventArgs e)
            TextBox txt = (TextBox)LoginArea.FindControl("UserName");
            MembershipUser mm = Membership.GetUser(txt.Text);
            if (mm.IsApproved)

     i do not know if i'm doing some thing wrong??.

    thank you in advance for your help

    Friday, October 5, 2007 3:01 PM

All replies

  • User546723956 posted

    i found out the solution.

    the login is in a nested in loginview, so i changed the code

    Login log = (Login)LoginArea.FindControl("Login1");

    TextBox txtb = (TextBox)log.FindControl("UserName");

    MembershipUser mm = Membership.GetUser(txtb.Text);

    that is all

    Friday, October 5, 2007 3:48 PM