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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T13:27:33+00:00 2026-06-15T13:27:33+00:00

I am trying to authenticate through WebSecurity class. I have a form and when

  • 0

I am trying to authenticate through WebSecurity class.

I have a form and when a user submits this is called:

@{
    if(IsPost) {
        var username = Request["username"];
        var password = Request["password"];

        WebSecurity.CreateAccount(username, password, false);

        WebSecurity.Login(username, password);

        Response.Redirect("Default.cshtml");
    }

}  

I already call:

WebSecurity.InitializeDatabaseConnection("Veidibok", "UserProfile", "UserId", "Email", true);

in my _appStart.cshtml file.

I get this error from the CreateAccount() call:

[MembershipCreateUserException: The Provider encountered an unknown
error.]
WebMatrix.WebData.SimpleMembershipProvider.CreateAccount(String
userName, String password, Boolean requireConfirmationToken) +1312
WebMatrix.WebData.WebSecurity.CreateAccount(String userName, String
password, Boolean requireConfirmationToken) +31
ASP._Page_Authentication_Register_cshtml.Execute() in
c:\Users\Notandi\Documents\My Web
Sites\VeidiBok\Authentication\Register.cshtml:6
System.Web.WebPages.WebPageBase.ExecutePageHierarchy() +207
System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1
executors) +68 System.Web.WebPages.WebPage.ExecutePageHierarchy()
+156 System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext
pageContext, TextWriter writer, WebPageRenderingBase startPage) +76
System.Web.WebPages.WebPageHttpHandler.ProcessRequestInternal(HttpContextBase
httpContext) +119

So anyone have any ideas? I’m really new at this, just trying out WebMatrix and .cshtml

  • 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-15T13:27:34+00:00Added an answer on June 15, 2026 at 1:27 pm

    Okay, this problem was a pain in my butt for the better part of today. I eventually had to check out the source code on Codeplex to get a better idea of what’s happening (http://aspnetwebstack.codeplex.com/SourceControl/changeset/view/ae31d2579b9a#src%2fWebMatrix.WebData%2fSimpleMembershipProvider.cs)

    It seems that the CreateAccount primarily creates account information in the membership table but before it does that the method will check for the presence of a user with the same userName in the User profile table specified in the Initialize statement WebSecurity.InitializeDatabaseConnection

    You can either call the CreateUser before you call the CreateAccount method or call the convenience method CreateUserAndAccount.

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

Sidebar

Related Questions

I'm trying to authenticate a user through the RESTful API (not Connect) but I
I'm trying to authenticate user accounts in Windows Phone. I found this C# library
I am trying to authenticate a user through the Magento Go SOAP API and
I have been trying to authenticate my CGI application through 2 drivers, one that
I'm trying to connect to TFS 2010 through the .Net Microsoft.TeamFoundation.Client.TeamFoundationServer class (in this
When am trying to authenticate the user through LDAP from database am getting the
I trying authenticate user in Spring Security application via oAuth. I'm already received token
I'm trying to Authenticate users by their emails instead of username. I'm using django-userena
I'm trying to authenticate to a web server from an android class with the
I am currently trying to Authenticate through WebSeal to a web service from within

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.