Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Membershipuser in winform

Posted on 2013-01-28
4
Medium Priority
?
450 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 2000 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

The top UI technologies you need to be aware of

An important part of the job as a front-end developer is to stay up to date and in contact with new tools, trends and workflows. That’s why you cannot miss this upcoming webinar to explore the latest trends in UI technologies!

Question has a verified solution.

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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
What do responsible coders do? They don't take detrimental shortcuts. They do take reasonable security precautions, create important automation, implement sufficient logging, fix things they break, and care about users.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Progress

715 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