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

  • SEARCH
  • Home
  • 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 7192731
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:00:12+00:00 2026-05-28T20:00:12+00:00

HELP……Just moved to C# from vb and Im really lost with this. var ldapmembershipUser

  • 0

HELP……Just moved to C# from vb and Im really lost with this.

var ldapmembershipUser = (LdapMembershipUser)System.Web.Security.Membership.GetUser("username");
var cnAttributeValues = ldapmembershipUser.Attributes["cn"];

Code bails at cnAttributeValues with Object reference not set to an instance of an object.

I dont know how to set it as a new ?? Object?

This is in reference to the nJupiter google controls.

  • 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-28T20:00:13+00:00Added an answer on May 28, 2026 at 8:00 pm

    Membership.GetUser(string) is documented to return:

    A MembershipUser object representing the specified user. If the username parameter does not correspond to an existing user, this method returns Nothing.

    So that’s what’s happening here – ldapmembershipUser is null because there’s no such user. You should check for that and act accordingly:

    // Note name casing change here to keep my sanity.
    if (ldapMembershipUser == null)
    {
        // Take appropriate action
    }
    

    Note that you could also have problems if GetUser returns a reference to an object which isn’t an LdapMembershipUser.

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

Sidebar

Related Questions

Help. This don't work after it set menuInput. It always just go to :opties.
Help! I am absolutely clueless on this. I've been told that the web application
Help, I have this class var jMath = { pi2: Math.PI, foo: function() {
help me please with this simple E-sql query: var qStr = SELECT SqlServer.Month(o.DatePaid) as
Help me in reading this dictionary: (its an NSDictionary generated from XMLData) Menus =
Help! I have an Axis web service that is being consumed by a C#
HELP! I just setup a virtual host for two sites that have a lot
Help me settle an argument here. Is this: SqlCommand cmd = new SqlCommand( sql
Help for this specific server side php code I don't have any knowledge of
Help me with this part of code: class Ooo attr_accessor :class_array end def func(ctx)

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.