Solved

Membershipuser in winform

Posted on 2013-01-28
4
410 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
  • 2
  • 2
4 Comments
 
LVL 41

Accepted Solution

by:
guru_sami earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
Worked - thanks
0

Featured Post

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Suggested Solutions

A short article about a problem I had getting the GPS LocationListener working.
Although it can be difficult to imagine, someday your child will have a career of his or her own. He or she will likely start a family, buy a home and start having their own children. So, while being a kid is still extremely important, it’s also …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now