473,387 Members | 1,592 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Validation Control question

For a Password field I would like a Validation Control to make sure
the password contains alphanumeric and number and has 8 characters.
What Validation Control can I use for this purpose ?
Thank you.

Apr 23 '07 #1
2 1380
You could do a regular expression. Regexlib has a great array of sample
regular expressions and you may be able to find an exact match for what
you're looking for, or get some ideas on how to make yours.

http://regexlib.com/default.aspx
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

<fi**********@gmail.comwrote in message
news:11*********************@y5g2000hsa.googlegrou ps.com...
For a Password field I would like a Validation Control to make sure
the password contains alphanumeric and number and has 8 characters.
What Validation Control can I use for this purpose ?
Thank you.

Apr 23 '07 #2
Thank you for your help.
I tried the regular expression ^.{4,8}$ but even when I type in "asdf",
"1234", or "asdf1234" when I click on the submit button it keeps giving me
the error "Password must be between 4 and 8 characters in length". What did
I do wrong in the following Page1.aspx ? Thank you.
<body>
<form id="form1" runat="server">
<div>
<input id="txtPassword" runat=server type="password" />&nbsp;
<asp:RegularExpressionValidator ID="RegularExpressionValidator1"
runat="server" ControlToValidate="txtPassword"
ErrorMessage="Password must be between 4 and 8 characters in length"
ValidationExpression="^.{4,8}$"></asp:RegularExpressionValidator>
<br />
<asp:Button ID="txtSubmit" runat="server" Text="Submit" /></div>
</form>
</body>

"Mark Fitzpatrick" <ma******@fitzme.comwrote in message
news:eG**************@TK2MSFTNGP06.phx.gbl...
You could do a regular expression. Regexlib has a great array of sample
regular expressions and you may be able to find an exact match for what
you're looking for, or get some ideas on how to make yours.

http://regexlib.com/default.aspx
--
Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006

<fi**********@gmail.comwrote in message
news:11*********************@y5g2000hsa.googlegrou ps.com...
>For a Password field I would like a Validation Control to make sure
the password contains alphanumeric and number and has 8 characters.
What Validation Control can I use for this purpose ?
Thank you.


Apr 23 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Colin Basterfield | last post by:
Hi, I have a web form which takes daily sales totals, both counts and monetary value and is done on a weekly basis, so on a Monday morning the User would enter these totals. Each total has a...
14
by: Matt | last post by:
I want to know if ASP.NET Web Forms Validation Controls are Server-Side or Client-Side form validation? Since I think each validator control can select either 1) JavaScript based error dialog or 2)...
1
by: Stephen Adam | last post by:
Hi there, I have written a custom validation control which checks to see of an input field is not empty and contains only numeric data. I was using a regular expression validation control but...
5
by: Chris | last post by:
Based upon some prevoius postings on what to do for adding a 'add' row to a datagrid I utilize the footer to create the 'add' row. The only issue is that I have it sharing the 'UpDate_Command' and...
1
by: Jack | last post by:
Hi, I have a page with a repeater control that contains textboxes. I'm trying to create a validation class that is called by my page. A method in this class iterates through all the controls...
5
by: Richard Brown | last post by:
Ok, I've been looking through the .NET SDK docs and stuff. I'm wondering if you can provide a control extender that does generic validation or functionality just by dropping it on the form. For...
1
by: Buddy Ackerman | last post by:
I don't know what the problem is. I have a form with several controls that need to be validated, I put a validation group in every form control, every validatoino control, the submit button and...
2
by: dustbort | last post by:
I recently had a problem where my required field validator stopped working. But, the page still posted back and tried to insert a record into the database without performing server-side validation....
1
by: brantman | last post by:
Here is a question that needs to be revisited. I noticed that there are more that a few posts about this in this group and in custom controls. Here is the problem: When inheriting from a...
11
by: Rik | last post by:
Hello guys, now that I'm that I'm working on my first major 'open' forms (with uncontrolled users I mean, not a secure backend-interface), I'd like to add a lot of possibilities to check wether...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.