Click here to Skip to main content
15,882,055 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more: , +
How to validate the length of character entered in a web method of Web service in asp.net with C#?
We are using VS 2005 and c# 2.0.
Posted
Updated 21-Apr-14 3:33am
v4
Comments
swapnil_jadhav 21-Apr-14 8:56am    
Can you post the code that you have tried so far?
[no name] 21-Apr-14 8:57am    
That would depend on what you think a "length of character" is. A character has a length of 1.
Dave Kreskowiak 21-Apr-14 9:34am    
Too bad I can't upvote this. A virtual 5 for you sir!
[no name] 21-Apr-14 10:11am    
Why thank you sir! You honor me.
Dave Kreskowiak 21-Apr-14 11:45am    
You are most welcome!

1 solution

You can use Regular Expression here.Please check below link for more info.

RegEx Max and Min length characters
 
Share this answer
 
Comments
ZurdoDev 21-Apr-14 9:44am    
RegEx seems overkill for checking length since no one actually understand RegEx syntax. :)
Sampath Lokuge 21-Apr-14 9:49am    
Please read this.You'll be master in Regex withing 30 Minutes. :)
http://www.codeproject.com/Articles/9099/The-Minute-Regex-Tutorial
ZurdoDev 21-Apr-14 9:50am    
Bookmarked. Thanks.
Sampath Lokuge 21-Apr-14 9:53am    
My Pleasure :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900