Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6789021
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:33:16+00:00 2026-05-26T17:33:16+00:00

I’ve been able to find lots of stuff about using the ASP .NET Membership

  • 0

I’ve been able to find lots of stuff about using the ASP .NET Membership provider in WPF. I’ve even got the ASP .NET Role provider working in my WPF application. These are very easy to use in WPF. What I can’t find any information about is how to use the ASP .NET PROFILE provider in a WPF application.

My application will be running on a laptop located in a moving vehicle; it cannot use Web Services to connect to a server and authenticate the user. My code needs to be able to retrieve the user’s profile information from the local database.

I’ve tried several times to build a class that derives from ProfileBase but nothing I’ve tried has worked. To elaborate, the code below is an excerpt from my latest failed attempt:

public class UserProfile : ProfileBase {

    [CustomProviderData( "AlarmsToDisplay;int" )]
    public int AlarmsToDisplay {
        get { return (int) GetPropertyValue( "AlarmsToDisplay" ); }
        set { SetPropertyValue( "AlarmsToDisplay", value ); }
    }

    // Other properties following the same pattern follow.

    private UserProfile() { }

    public static UserProfile GetUserProfile( string username ) {
        return Create( username ) as UserProfile;
    }

    public static UserProfile GetUserProfile( string username, bool isAuthenticated ) {
        return Create( username, isAuthenticated ) as UserProfile;
    }
}

In this code, the method GetUserProfile( string username, bool isAuthenticated ) returns null. I believe this is because the compiler can’t cast a ProfileBase to a UserProfile, even though UserProfile descends from ProfileBase. Please correct me if I’m wrong.

Can someone point me to an existing article or describe the proper way to build a user profile class that extends from ProfileBase?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:33:16+00:00Added an answer on May 26, 2026 at 5:33 pm

    I’ve managed to resolve this issue on my own. Here’s what works:

    1. Remove the attributes from all of the CLR properties. These do not work with the default aspnet_Profiles table.
    2. In app.Config, you need to add an “inherits” attribute to the tag. This has to be set to the fully qualified name of your class, separated from the assembly file name (no extension) by a comma.

    Once these things were done, the GetUserProfile method and the ProfileBase class’s Create methods return UserProfile objects.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am reading a book about Javascript and jQuery and using one of the
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
Seemingly simple, but I cannot find anything relevant on the web. What is the
I've got a string that has curly quotes in it. I'd like to replace
I am using the SimpleRSS gem to parse a WordPress RSS feed. The only
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.