Click here to Skip to main content
15,860,861 members
Articles / Web Development / ASP.NET
Article

ZatakTextBox

Rate me:
Please Sign up or sign in to vote.
4.64/5 (12 votes)
15 Dec 20063 min read 72.7K   790   69   19
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 :).

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


Written By
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
This is a Organisation (No members)


Comments and Discussions

 
GeneralCan't we display the error message on right end side of textbox Pin
rekhakapadia17-Nov-09 23:46
rekhakapadia17-Nov-09 23:46 
GeneralRe: Can't we display the error message on right end side of textbox Pin
Manish Pansiniya18-Nov-09 7:52
Manish Pansiniya18-Nov-09 7:52 
GeneralCould not load file or assembly eWorld.UI Pin
Essar18-May-08 23:02
Essar18-May-08 23:02 
GeneralRe: Could not load file or assembly eWorld.UI Pin
Manish Pansiniya19-May-08 1:07
Manish Pansiniya19-May-08 1:07 
GeneralZatakTextBox Pin
M_Menon25-Sep-07 21:31
M_Menon25-Sep-07 21:31 
Generalnice extension Pin
g00fyman18-Feb-07 20:47
g00fyman18-Feb-07 20:47 
GeneralRe: nice extension Pin
Manish Pansiniya19-Feb-07 3:37
Manish Pansiniya19-Feb-07 3:37 
QuestionCould not load file or assembly eWorld.UI Pin
Sebahat14-Feb-07 2:55
Sebahat14-Feb-07 2:55 
AnswerRe: Could not load file or assembly eWorld.UI Pin
Manish Pansiniya14-Feb-07 4:02
Manish Pansiniya14-Feb-07 4:02 
GeneralRe: Could not load file or assembly eWorld.UI Pin
Sebahat14-Feb-07 4:33
Sebahat14-Feb-07 4:33 
GeneralRe: Could not load file or assembly eWorld.UI Pin
Manish Pansiniya15-Feb-07 4:32
Manish Pansiniya15-Feb-07 4:32 
GeneralRe: Could not load file or assembly eWorld.UI Pin
Sebahat14-Feb-07 4:36
Sebahat14-Feb-07 4:36 
GeneralError Report Pin
RajaSrirangan20-Dec-06 2:25
RajaSrirangan20-Dec-06 2:25 
GeneralRe: Error Report Pin
Manish Pansiniya20-Dec-06 4:28
Manish Pansiniya20-Dec-06 4:28 
GeneralRe: Error Report Pin
RajaSrirangan22-Dec-06 3:45
RajaSrirangan22-Dec-06 3:45 
GeneralRe: Error Report Pin
RajaSrirangan22-Dec-06 3:56
RajaSrirangan22-Dec-06 3:56 
GeneralRe: Error Report [modified] Pin
Manish Pansiniya22-Dec-06 4:26
Manish Pansiniya22-Dec-06 4:26 
GeneralRight on time Pin
Patrick Luijpers16-Dec-06 17:14
Patrick Luijpers16-Dec-06 17:14 
GeneralRe: Right on time Pin
J. Wijaya8-Dec-10 18:49
J. Wijaya8-Dec-10 18:49 

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

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