Solved

Membershipuser in winform

Posted on 2013-01-28
4
427 Views
Last Modified: 2013-01-30
I am trying to use Membership.getuser and it keeps erroring out anyone know why
 public int uuid { get; set; }
        Security.MembershipUser selectedUser = Membership.GetUser(Convert.ToInt32(uuid), false); 

Open in new window

A field initializer cannot reference the non-static field, method, or property
0
Comment
Question by:r3nder
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
ID: 38828917
Where is your this line of code placed?
 Security.MembershipUser selectedUser = Membership.GetUser(Convert.ToInt32(uuid), false); 

Open in new window

0
 
LVL 6

Author Comment

by:r3nder
ID: 38829006
namespace PLM{
    public partial class AddUser : RadForm
    {
public int uuid { get; set; }
        Security.MembershipUser selectedUser = Membership.GetUser(Convert.ToInt32(uuid), false);
0
 
LVL 41

Expert Comment

by:guru_sami
ID: 38829018
That initialization should be moved inside the Load or some method and not outside in a class...
0
 
LVL 6

Author Closing Comment

by:r3nder
ID: 38835934
Worked - thanks
0

Featured Post

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Uploading external document (PNG) into SalesForce.com dashboard 2 21
Shared Service Environment 2 54
VLC command 34 79
Need a quick overview of Selenium testing 2 35
If you’re thinking to yourself “That description sounds a lot like two people doing the work that one could accomplish,” you’re not alone.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question