Regex: Check Asp.Net Membership is valid.

by Pieter Brinkman 14. January 2009 04:55

The following RegularExporessionValidator checks if the text-input is correct format for a user-name.

 

<asp:RegularExpressionValidator runat="server" ID="userNameRegexVD" ControlToValidate="userNameTxt" ValidationExpression="^([a-zA-Z])[a-zA-Z_-]*[\w_-]*[\S]$|^([a-zA-Z])[0-9_-]*[\S]$|^[a-zA-Z]*[\S]$" ErrorMessage="Invalid username" />

 

Tags: , , ,

ASP.Net

Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen

About Me

My name is Pieter Brinkman I am Solution Architect for Sitecore in The Netherlands. My interests are mainly ASP.NET, MSSQL and Content Management Systems.

Calendar

<<  February 2012  >>
MoTuWeThFrSaSu
303112345
6789101112
13141516171819
20212223242526
2728291234
567891011

View posts in large calendar

RecentComments

Comment RSS

Most comments