Click here to Skip to main content
Click here to Skip to main content
Go to top

ZatakTextBox

, 15 Dec 2006
Rate this:
Please Sign up or sign in to vote.
This textbox contains everything for validation. You can set validation options by a click of the mouse and just a few keystrokes.

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 Smile | :) .

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

Share

About the Author

Manish Pansiniya
Founder IntelliPro Solutions Pvt. Ltd.
India India
A 8 or something in .NET, living in Ahmedabad, India owned IntelliPro Solutions Pvt. Ltd..
 
Currently working on .NET technologies, MVC and Silverlight.
 
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 http://maniish.wordpress.com.
 
To contact me, post comment here or email me at manish AT iprospl.com
Group type: Organisation (No members)


Follow on   Twitter

Comments and Discussions

 
GeneralCan't we display the error message on right end side of textbox Pinmemberrekhakapadia17-Nov-09 23:46 
GeneralRe: Can't we display the error message on right end side of textbox PinmemberManish Pansiniya18-Nov-09 7:52 
GeneralCould not load file or assembly eWorld.UI PinmemberEssar18-May-08 23:02 
GeneralRe: Could not load file or assembly eWorld.UI PinmemberManish Pansiniya19-May-08 1:07 
GeneralZatakTextBox Pinmembermady138025-Sep-07 21:31 
Generalnice extension Pinmemberg00fyman18-Feb-07 20:47 
GeneralRe: nice extension PinmemberManish Pansiniya19-Feb-07 3:37 
QuestionCould not load file or assembly eWorld.UI PinmemberSebahat14-Feb-07 2:55 
AnswerRe: Could not load file or assembly eWorld.UI PinmemberManish Pansiniya14-Feb-07 4:02 
GeneralRe: Could not load file or assembly eWorld.UI PinmemberSebahat14-Feb-07 4:33 
GeneralRe: Could not load file or assembly eWorld.UI PinmemberManish Pansiniya15-Feb-07 4:32 
GeneralRe: Could not load file or assembly eWorld.UI PinmemberSebahat14-Feb-07 4:36 
GeneralError Report PinmemberRajaSrirangan20-Dec-06 2:25 
GeneralRe: Error Report PinmemberManish Pansiniya20-Dec-06 4:28 
GeneralRe: Error Report PinmemberRajaSrirangan22-Dec-06 3:45 
GeneralRe: Error Report PinmemberRajaSrirangan22-Dec-06 3:56 
GeneralRe: Error Report [modified] PinmemberManish Pansiniya22-Dec-06 4:26 
GeneralRight on time PinmemberPatrick Luijpers16-Dec-06 17:14 
GeneralRe: Right on time PinmemberMr. J8-Dec-10 18:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Mobile
Web04 | 2.8.140916.1 | Last Updated 15 Dec 2006
Article Copyright 2006 by Manish Pansiniya
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid