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 7777743
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T18:13:16+00:00 2026-06-01T18:13:16+00:00

I have a Silverlight web app using WCF and Membership.CreateUser to create new users.

  • 0

I have a Silverlight web app using WCF and Membership.CreateUser to create new users.

If I successfully create a user, then create another user, I get the “User sucessfully created” status message twice. Or if my first attempt at creating a new user fails, say because the username already exists, any further attempts brings back the status messages more than once.

My WCF service code

[OperationContract]
public MembershipCreateStatus CreateNewUser(string userName, string password, string email, string securityQuestion, string securityAnswer)
{
   MembershipCreateStatus status = new MembershipCreateStatus();
   MembershipUser newUser = Membership.CreateUser(userName, password, email, securityQuestion, securityAnswer, true, out status);

   return status;
}

My call to the method

tmsClient.CreateNewUserCompleted += new EventHandler<CreateNewUserCompletedEventArgs>(tmsClient_CreateNewUserCompleted);
tmsClient.CreateNewUserAsync(nu.UserName, nu.Password, nu.Email, nu.SecurityQuestion, nu.SecurityAnswer);

My event completed

void tmsClient_CreateNewUserCompleted(object sender, CreateNewUserCompletedEventArgs e)
{
    MembershipCreateStatus status = e.Result;
    string result = GetErrorMessage(status);
    MessageBox.Show(result);
}

And lastly the GetErrorMessage method

public string GetErrorMessage(MembershipCreateStatus status)
{
    switch (status)
    {
        case MembershipCreateStatus.Success:
            return "The user was successfully created.";

        case MembershipCreateStatus.DuplicateUserName:
            return "Username already exists. Please enter a different user name.";

        case MembershipCreateStatus.DuplicateEmail:
            return "A username for that e-mail address already exists. Please enter a different e-mail address.";

        case MembershipCreateStatus.InvalidPassword:
            return "The password provided is invalid. Please enter a valid password value.";

        case MembershipCreateStatus.InvalidEmail:
            return "The e-mail address provided is invalid. Please check the value and try again.";

        case MembershipCreateStatus.InvalidAnswer:
                return "The password retrieval answer provided is invalid. Please check the value and try again.";

        case MembershipCreateStatus.InvalidQuestion:
                return "The password retrieval question provided is invalid. Please check the value and try again.";

        case MembershipCreateStatus.InvalidUserName:
                return "The user name provided is invalid. Please check the value and try again.";

        case MembershipCreateStatus.ProviderError:
            return "The authentication provider returned an error. Please verify your entry and try again. If the problem persists, please contact your system administrator.";

        case MembershipCreateStatus.UserRejected:
            return "The user creation request has been canceled. Please verify your entry and try again. If the problem persists, please contact your system administrator.";

        default:
            return "An unknown error occurred. Please verify your entry and try again. If the problem persists, please contact your system administrator.";
    }
}

Any ideas as to why this is happening?
Tx

Neill

  • 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-06-01T18:13:18+00:00Added an answer on June 1, 2026 at 6:13 pm

    I guess you add the handler for CreateNewUserCompleted just before calling the CreateNewUserAsync method and then never remove it. Your tmsClient_CreateNewUserCompleted method should look sth like this to get this working properly:

    void tmsClient_CreateNewUserCompleted(object sender, CreateNewUserCompletedEventArgs e)
    {
        tmsClient.CreateNewUserCompleted -= new EventHandler<CreateNewUserCompletedEventArgs>(tmsClient_CreateNewUserCompleted);
        MembershipCreateStatus status = e.Result;
        string result = GetErrorMessage(status);
        MessageBox.Show(result);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Silverlight web app which uses ASP.net Website administration tool for user
I have a WCF web-service and a Silverlight app displaying data from that service.
I am using a Silverlight usercontrol in my ASP.NET web app. The user control
I have built a web setup project in VS2008 which installs my ASP.NET/Silverlight app
I have created a web application with a Silverlight project embedded in it, using
I am building a web app in Silverlight which allows users to view and
I have a Silverlight application using a WCF service hosted in IIS. I make
I have a silverlight app using Prism practices; the current code does a search
I am developing a web app using silverlight. I read that Microsoft offers 10
I have a C# Silverlight app that lets the user select which spreadsheet they

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.