0

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?

2
Contributors
4
Replies
14
Views
4 Years
Discussion Span
Last Post by coder91
0

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?

0

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

0

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.

Edited by LastMitch: grammer

0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.