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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T20:37:43+00:00 2026-05-22T20:37:43+00:00

I have a database field (postcode) that I want to contain upper case characters,

  • 0

I have a database field (postcode) that I want to contain upper case characters, spaces and numbers. No lower case or other punctuation. I’d like to deal with that as declaratively as possible. One way would be to use a regular expression DataAnnotation to validate, [A-Z][0-9]\w (or similar – I’m not a regular expression expert, but I’m sure the right regular expression is there to be found). That would do half of what I want – it would force the user to input in uppercase, but it wouldn’t convert to uppercase.

If I want to convert to uppercase there are some solutions in Stack Overflow question How can I force input to uppercase in an ASP.NET textbox?, but none of them are particularly declarative. At the moment I’m thinking of a combination of the validation and jQuery to spot anything with a class of “uppercaseonly” and convert the data, but it’s a bit messy.

Am I missing anything?

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

    CSS text-transform: uppercase?

    http://www.w3schools.com/css/pr_text_text-transform.asp

    UPDATE:

    Try implementing a custom ModelBinder. Here’s an example: http://www.agileatwork.com/custom-model-binder-in-asp-net-mvc/

    Instead of AddRoles just set the property to uppercase. No need to touch your EF classes.

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

Sidebar

Related Questions

I have a database field called abCode , that I want to map to
I have a database with a field that holds permit numbers associated with requests.
I have a comma delimited string held within a database field that could contain
I have a database field where I want to store my password. In a
I have a database table with a field that I need to read from
In the database I have a field with a .mht file. I want to
I have a SQL database that has a table with a field set to
I have a database field with data such as this: 76,60,12 If I want
I have a database with a field named Field1 that has 100 nchars per
I have a numeric database field (numeric(3) in SQL Server 2000) that allows nulls,

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.