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)
{
}
}
Contributor
2396 Points
724 Posts
Locate the userid
Oct 05, 2007 03:01 PM|mohi88|LINK
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.
i do not know if i'm doing some thing wrong??.
thank you in advance for your help
userid
MCSD.NET
My Blog ||My Tweets ||My Photos ||LinkedIn
Contributor
2396 Points
724 Posts
Re: Locate the userid
Oct 05, 2007 03:48 PM|mohi88|LINK
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
MCSD.NET
My Blog ||My Tweets ||My Photos ||LinkedIn