473,583 Members | 4,428 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1760
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.EnableValid ation
txt.MinValue
txt.MaxValue
txt.ErrorBackgr oundColor
txt.ErrorMessag e
txt.FriendlyNam e
txt.AutoUpCase

i do my own custom dropdownlist, custom this custom that

all of controls, i implement IValidator

Partial Class Controls_UCText box

Inherits CBaseControl

Implements IValidator

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

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

etc....
validationsumma ry 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...@g mail.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
StringLengthVal idator, 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**********@g mail.comwrote in message
news:11******** *************@n 39g2000hsh.goog legroups.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
5170
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 trace below. at System.Data.DataSet.FailedEnableConstraints() at System.Data.DataSet.EnableConstraints() at...
1
1444
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 forms don't work. I found that if I remove all the Validation controls the post works fine off the button clicks. So the Validation Controls seem...
2
1038
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 controls seem to block all eventHandlers that are connected to link buttons. How can I distinguish which events the validation controls are to...
4
2709
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 If the message contains the word porn, can I block the whole message using a validation rule
11
2982
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 certain fields match certain criteria, and inform the user in different ways when the data is wrong (offcourse, this will be checked on posting the...
1
1633
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 create valid css? body { margin: 0 0%; padding: 0; font-family: "Myriad Web Pro", Geneva, Helvetica, sans-serif; font-size: .7em;...
2
1731
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> <script> function toggle_display() { var form = document.getElementById('hidesubmit');
0
803
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 object's implementation and move it to the derived object then the method is called. I have tried many different ways to get this to function an...
37
3643
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 over" when there are <br /tags involved...??? I've tried using <p style="font-weight: bold;"></p>, I've tried <blockquote></blockquote>...I just...
0
7894
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7825
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8179
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8323
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
5700
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5372
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3816
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2331
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1431
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.