So having an error when I select my button in the gridview. Was told to use the gridview row command which I have, keep getting an error about the App_Data subdirectory.

  protected void gvUnlock_RowCommand(object sender, GridViewCommandEventArgs e)
        {

                String userName = e.CommandArgument.ToString();

                MembershipUser usr = Membership.GetUser("userName");
                if ((usr != null) && (usr.IsLockedOut))
                {
                    usr.UnlockUser();
                    gvUlockLevypayer.DataBind();

                }
        }

Do I need to add another if statement in below the method creation to state if the button has been selected?

Recommended Answers

All 4 Replies

Member Avatar for LastMitch

Was told to use the gridview row command which I have, keep getting an error about the App_Data subdirectory.

What error did you get?

Something like this:

Access denied creating App_Data sub directory

You didn't Configuration it yet.

What kind of website you are trying to created?

Regular website or mobile website?

Yea thats the error I'm getting. It's just a regular website.

Member Avatar for LastMitch

Yea thats the error I'm getting. It's just a regular website.

I thought you already resolve this issue already from the other thread?

You need to set the configuration for the members to access a page that you want them to.

You are getting that error because you didn't configure:

MembershipUser usr

Read this and set the configuration:

http://msdn.microsoft.com/en-us/library/879kf95c%28en-US,VS.80%29.aspx

If you don't do that this error will get appearing and you won't be able to add code to the MembershipUser usr until it has permission to do that.

figured out the problem I was using

MembershipUser usr = Membership.GetUser("userName");

so it was checking for "userName" instead of what i'd set userName to.

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.