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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T11:53:33+00:00 2026-05-23T11:53:33+00:00

In my register view, I have: <div> @Html.ValidationMessageFor(m => m.Password) </div> If I use

  • 0

In my register view, I have:

<div>
    @Html.ValidationMessageFor(m => m.Password)
</div>

If I use a password like foobar100 the validation fails however the error message doesn’t provide a proper reason why it failed. I.e. The password provided is invalid. Please enter a valid password value. It will only work if I do something like foob@r100.

Is there a way to reduce the strictness of the validation rules? Or at least change the validation error message?

Update

The data validation attributes on the object I am checking are:

    [Required]
    [StringLength(100, ErrorMessage = "The {0} must be at least {2} characters long.", MinimumLength = 6)]
    [DataType(DataType.Password)]
    [Display(Name = "Password")]
    public string Password { get; set; }

which say nothing about requiring an @ symbol.

  • 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-23T11:53:34+00:00Added an answer on May 23, 2026 at 11:53 am

    To reduce the validation strictness. E.g. not have the need for alphanumeric characters. You need to alter the MembershipProvider properties. This can be done via the web.config file as per http://msdn.microsoft.com/en-us/library/system.web.security.membershipprovider.minrequirednonalphanumericcharacters.aspx.

       <membership>
              <providers>
                  <clear/>
                  <add name="AspNetSqlMembershipProvider"
                    type="System.Web.Security.SqlMembershipProvider"
                    connectionStringName="LocalSqlServer"
                    enablePasswordRetrieval="false"
                    enablePasswordReset="true"
                    requiresQuestionAndAnswer="false"
                    requiresUniqueEmail="false"
                    maxInvalidPasswordAttempts="5"
                    minRequiredPasswordLength="6"
                    minRequiredNonalphanumericCharacters="0"
                    passwordAttemptWindow="10"
                    applicationName="/"/>
              </providers>
          </membership>
    

    You can then better control the level of strictness via Danny Tuppeny’s answer.

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

Sidebar

Related Questions

I have created view page in MVC like <%using (Html.BeginForm()) { %> <%=LabelHelpers.Label(firstname, FirstName:)%>
I have a User model. It has register view containing a form that looks
i've a login view presented as a ModelViewController and i have a register view
Is there a way to view the register contents in each stack frame in
I have a UITableView instance variable. I want to be able to register my
Scenario: I have a View and inside that view I also a partial view.
I have an HTML form in my site, and for whatever reason I am
I have users registration procedure on my app. But my users have to register
I have 2 views, login and register. I did [currentTextField resignFirstResponder]; before I navigates
I 'am building a small windows form application. I have a View - a

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.