473,406 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Validation block

Im a new bee in validation

Im just in the design phase of the project and not thinking about
having a saperate validaion block.

Just browsed through validaion block of enterprise library which is
one of the options which ill use..

I would be glad if some one help me with any of the resources or idea
of how to handle validaitons in project..Like creating saperate
component for validation.

Oct 4 '07 #1
2 1724
my custom textbox has something like this

txt.Required = true
txt.DataType = String,Integer,Money,Date, RegExp etc...
txt.RegExp = "#@$@"
txt.AutoTrim = true
txt.MinLength
txt.MaxLenght
txt.EnableValidation
txt.MinValue
txt.MaxValue
txt.ErrorBackgroundColor
txt.ErrorMessage
txt.FriendlyName
txt.AutoUpCase

i do my own custom dropdownlist, custom this custom that

all of controls, i implement IValidator

Partial Class Controls_UCTextbox

Inherits CBaseControl

Implements IValidator

Protected Overrides Sub OnInit(ByVal e As System.EventArgs)
MyBase.OnInit(e)
Page.Validators.Add(Me)
End Sub

Protected Overrides Sub OnUnload(ByVal e As System.EventArgs)
If Not IsNothing(Page) Then
Page.Validators.Remove(Me)
End If
MyBase.OnUnload(e)
End Sub

etc....
validationsummary will get messages from ErrorMessage (IValidator
method declaration). I learn this from codeproject, and enhance it
myself

I prefer this way, easy to maintain, and boosts employee's morale.
On Oct 4, 4:07 pm, jack <gautams.m...@gmail.comwrote:
Im a new bee in validation

Im just in the design phase of the project and not thinking about
having a saperate validaion block.

Just browsed through validaion block of enterprise library which is
one of the options which ill use..

I would be glad if some one help me with any of the resources or idea
of how to handle validaitons in project..Like creating saperate
component for validation.

Oct 4 '07 #2
If you are going to use Validation Block, this is how I used it.

I store regular expression validations on the database extended properties
description for each field. The first line is always a description; followed
by carriage return, regular expression, carriage return, and regular
expression error message. I then used CodeSmith and wrote a template to
write my Data Transfer Object with Validation Block attributes for
StringLengthValidator, Allow Nulls, Comment Description, Regular
Expressions, etc. using the values in the database extended properties and
DB Schema.


You can also use Policy Injection with Validation Block for additional
validations.

Regards,

Brian K. Williams

"jack" <ga**********@gmail.comwrote in message
news:11*********************@n39g2000hsh.googlegro ups.com...
Im a new bee in validation

Im just in the design phase of the project and not thinking about
having a saperate validaion block.

Just browsed through validaion block of enterprise library which is
one of the options which ill use..

I would be glad if some one help me with any of the resources or idea
of how to handle validaitons in project..Like creating saperate
component for validation.

Oct 4 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Sudip Chakraborty | last post by:
Is there a way to see constraint validation errors while loading xml into a DataSet ? I'm interested in the line number in the xml file which is causing the error. I've enclosed the relevant stack...
1
by: Chris Tillotson | last post by:
Thanks in advance... I have an odd problem. I developed a .net app on my home computer and it works fine but when I put it on the hosted environment my ImageButtons that are supposed to post my...
2
by: Pho Bo Vien | last post by:
I have several link buttons on a page and many validation controls. I want the validation controls to block the user from submitting the form unless their conditions are satisfied -- however, the...
4
by: ron | last post by:
I have a access based guest book. I want to create a validation rule to block certain words or parts of a srting. How do i do this? ie: this is a nice site. come visit my porn site at www.abc.zy...
11
by: Rik | last post by:
Hello guys, now that I'm that I'm working on my first major 'open' forms (with uncontrolled users I mean, not a secure backend-interface), I'd like to add a lot of possibilities to check wether...
1
by: windy | last post by:
Hello Forum, I sure struggle with css validation. Attached is a sample of the css I have run through the w3 validator and it comes up no errors or warnings. What is the correct process used to...
2
by: plumba | last post by:
Ok, another problem... A bit querky this one.. My form calls an onsubmit function to check fields for completion (validation check). Here is a breakdown version of the form: <html>...
0
by: rpeters74 | last post by:
Within a base object I want to encapsulate the call to the Validation Block. The following code block will not work. The method tag with SelfValidation is never called. If I were to take the base...
37
by: Prisoner at War | last post by:
Actually, it doesn't have to be a blockquote...but I'm at my wits' end: I want to make bold several lines of text which have a pair of <br /tags between them...seems like the <b></bdo not "carry...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.