Click here to Skip to main content
6,595,444 members and growing! (18,100 online)
Email Password   helpLost your password?
Web Development » Validation » General     Intermediate

ZatakTextBox

By Manish Pansiniya

This textbox contains everything for validation. You can set validation options by a click of the mouse and just a few keystrokes.
C#, Windows, .NET, ASP.NET, Visual Studio, WebForms, Dev
Posted:15 Dec 2006
Views:31,034
Bookmarked:59 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
11 votes for this article.
Popularity: 4.98 Rating: 4.78 out of 5

1

2

3
1 vote, 9.1%
4
10 votes, 90.9%
5

Sample Image

Introduction

I was doing my usual programming, and one day, I was stuck in a big form that had too many textbox controls with many validations. I had a hard day putting all the things together on that page. I was a bit confused why Microsoft did not provide validations with the textbox itself. So, I have done that here. Now, nobody will have problems as I faced recently. Please send me any bug reports or suggestions for improving the textbox. This textbox is named as Zatak as I am a very big fan of the Zatak perfume. This textbox is like a simple textbox but it contains a lot of validation options which you can set using simple click and keystrokes. I am providing more details to you below. I am very thankful to Click2Install for providing me the initial framework. The source code is attached with the article and the zip file also contains a small demo of what the control can do.

Using the component

General Settings

General settings

There are different parts to the textbox control. The first part is the General Settings which are settings regarding the general validation control shown as above. It contains the focus on error, client script, validator display style, and method to show the validation. Currently, it supports text and icon. You can include other methods if you like.

Required Validation Settings

Required settings

The first validation is required validation. If you want this textbox as required, then tick on the checkbox and write the message into the textbox which you want to show to the user.

Regular Expression Validation Settings

Regular settings

The second validation is regular expression validation. If you want this textbox to behave as some fixed type then select it from the combobox. You can give different settings as per the selection. Like for alphanumericwithspecialchar, you will get a textbox to enter special characters. For decimal, you will be prompted for digits after decimal. And there is one option Custom where you can provide your own regular expression.

Range Validation Settings

Range settings

The third validation is range validation. If you want this textbox to include range validation, then tick this option. You can give different settings similar to the range validator.

Compare Validation Settings

Compare settings

The fourth validation is compare validation. If you want this textbox to include compare validation then tick this option. You can give different settings similar to the compare validator..

Custom Validation Settings

Custom settings

The fifth validation is custom validation. If you want to make a server function for validation, then implement the ServerValidate event.

Points of Interest

The first thing is sometimes there is memory problems in my Visual Studio 2005. I have put code to dispose the things that are allocated. But still if you find anything for improvements, then please let me know. All validations contain their own messages.

Currently there is a problem with the regular expression for date validation. I took it from a regular expression library site. It wass given for DD/MM/YYYY. But because I could not convert it to MM/DD/YYYY, I used another regular expression for MM/DD/YYYY. In that regular expression, 1/1/1 is not validated as date.

If you need anything regarding the code or its logic, please comment on this article.

If you find it useful or great then please rate this article a 5 :).

I have used the internal validators of ASP.NET 2.0 to build the validators behind the scenes.

And yes, do visit my Blog for upgrades and blogs about ASP.NET. I have recently started it and will post interesting article links, posts, snippets, and tools, and many other things that can save you time. So please subscribe to the RSS right now.

History

  • Version 1.0 - Initial release.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Manish Pansiniya


Member
A 29 or something, living in Ahmedabad, India working as Tech Lead.

Currently working on .NET 2.0 and moving on .NET 3.5 with Great Courage :P.

My little blog is for helping community with the solution for problems or helping them to understand new technology. You can reach to my blog at www.pansiniya.com/blog or maniish.wordpress.com.

To contact me, post comment here or email me at manish AT pansiniya.com
Occupation: Web Developer
Location: United States United States

Other popular Validation articles:

Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 16 of 16 (Total in Forum: 16) (Refresh)FirstPrevNext
GeneralCould not load file or assembly eWorld.UI PinmemberEssar0:02 19 May '08  
GeneralRe: Could not load file or assembly eWorld.UI PinmemberManish Pansiniya2:07 19 May '08  
GeneralZatakTextBox Pinmembermady138022:31 25 Sep '07  
Generalnice extension Pinmemberg00fyman21:47 18 Feb '07  
GeneralRe: nice extension PinmemberManish Pansiniya4:37 19 Feb '07  
QuestionCould not load file or assembly eWorld.UI PinmemberSebahat3:55 14 Feb '07  
AnswerRe: Could not load file or assembly eWorld.UI PinmemberManish Pansiniya5:02 14 Feb '07  
GeneralRe: Could not load file or assembly eWorld.UI PinmemberSebahat5:33 14 Feb '07  
GeneralRe: Could not load file or assembly eWorld.UI PinmemberManish Pansiniya5:32 15 Feb '07  
GeneralRe: Could not load file or assembly eWorld.UI PinmemberSebahat5:36 14 Feb '07  
GeneralError Report PinmemberRajaSrirangan3:25 20 Dec '06  
GeneralRe: Error Report PinmemberManish Pansiniya5:28 20 Dec '06  
GeneralRe: Error Report PinmemberRajaSrirangan4:45 22 Dec '06  
GeneralRe: Error Report PinmemberRajaSrirangan4:56 22 Dec '06  
GeneralRe: Error Report [modified] PinmemberManish Pansiniya5:26 22 Dec '06  
GeneralRight on time PinmemberPatrick Luijpers18:14 16 Dec '06  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 15 Dec 2006
Editor: Smitha Vijayan
Copyright 2006 by Manish Pansiniya
Everything else Copyright © CodeProject, 1999-2009
Web17 | Advertise on the Code Project