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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T00:12:01+00:00 2026-06-05T00:12:01+00:00

First question is, using StringLength, is it possible to specify only a minimum length?

  • 0

First question is, using StringLength, is it possible to specify only a minimum length? More importantly, this is what I have for a password.

private string password;
[Required]
[DataType(DataType.Password)]
[StringLength(15, MinimumLength = 6)]
public string Password { get { return password; } set { HashPassword(value); } }

What I want is when the user enters the password that they can only enter a minimum of 6 and maximum of 15 characters for their password. The issue lies in my Controller because ModelState.IsValid fails due to the hashing generating a huge string exceeding 15 characters. How can I get around this?

  • 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-05T00:12:02+00:00Added an answer on June 5, 2026 at 12:12 am

    I would recommend doing your hashing elsewhere (e.g. in the controller) instead of doing it in the set accessor of the property.

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

Sidebar

Related Questions

This is my first question on this site, and I only have a basic
This is my first question posting here. I'm novice to Flash builder,using Flash Builder
i have a question about using GalleryView. At first, i set five default images
I'm using the first answer to this question Overcoming Python's limitations regarding instance methods
This is my first time using stackoverflow for a question that I need to
My first question is, is it possible to specify a generic type as a
This is my first question so I'll try to be as descriptive as possible...
The first question is how to run a function using the URL, I have
This'll be my first question on this platform. I've done lots of development using
This is my first question on Stackoverflow. I'm wanting to make an A.I. using

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.