Hi I have a system that allows users to create an account. Theres then an admin side so that if users accounts get locked admin can go on to the unlockuser page where there will be a gridview listing all accounts that are locked out. On each row will be an unlock button, in the back end code I'm using the gridview row command where I have the membershipUser usr = membership.GetUser(); usr.UnlockUser(); All I want to know is what do I put in membershipUser usr = membership.GetUser(); Do I need to create a variable? This has already been created for the gridview in the business layer, I have int32 userID so is this what I put in ()? When i do it appears with a red line, so do I need to declare it in the back end code aswell?

Thanks in advance

Member Avatar for LastMitch

This has already been created for the gridview in the business layer, I have int32 userID so is this what I put in ()? When i do it appears with a red line, so do I need to declare it in the back end code aswell?

You can try this it's something you can start on (I don't know your variable so this is the just the beginning part):

private membershipUser usr RegisteredUsers = membership.GetUser(); 

     membershipUser usr myuser = membership.GetUser(); 

public void RefreshGridview()
{
    gUsers.DataSource = membership.GetUser(); 
    gUsers.DataBind();
}

protected void Page_Load(object sender, EventArgs e)
{
    btn_Delete.Visible = false;

    if (!IsPostBack)

    {

        lblNumberUsers.Text = membership.NumberUsersOnline().ToString();
        lblTotalUsers.Text = RegisteredUsers.Count.ToString();
        string[] alph = "A;B;C;D;E;F;G;J;K;L;M;N;O;P;Q;R;S;T;U;V;W;X;Y;Z;All".Split(';');

        rptAlphBar.DataSource = alph;
        rptAlphBar.DataBind();
    }
}
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.