473,385 Members | 1,553 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,385 software developers and data experts.

Validation Block - Cannot validate from Base Object

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 nothing seems to work.


------------------------------------------
Base Object
------------------------------------------
Public MustInherit Class BaseBusinessObject

Private _validationResults As New ValidationResults
Public Property ValidationResults() As ValidationResults
Get
Return _validationResults
End Get
Set(ByVal value As ValidationResults)
_validationResults = value
End Set
End Property

Public Overridable Function IsValid(ByVal ruleset As String) As Boolean
Me.ValidationResults = Validation.Validate(Me, ruleset:=ruleset)
Return Me.ValidationResults.IsValid
End Function

End Class


------------------------------------------
Derived Object
------------------------------------------
<SelfValidation(ruleset:="Search")> _
Public Sub DoValidate(ByVal results As ValidationResults)
results.AddAllResults(Validation.Validate(Me, ruleset:="ruleSet1"))
End Sub
Nov 19 '07 #1
0 793

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: dries | last post by:
A friend of mine has a problem with his credit card validation routine and it is probably a simple thing to solve but I cannot find it. It has to do with the expiry dates. What happens is that as...
7
by: A.M | last post by:
Hi, I have a validation control in my page that upon any invalid data, it disables all buttons in the page. basicly i don't have any postback in the page if the validator finds any error. How...
9
by: AFN | last post by:
I was just dropped into someone else's code (isn't that always so fun?). I can't figure out why a custom validation control's server event function is executing. There is nothing (that I see)...
9
by: Bill Long | last post by:
I have a control that simply displays a list of links. Following one of the links doesn't post back or redirect to another page, it simply hides the current panel and shows the one you selected......
0
by: sk | last post by:
I am trying to make validation program but getting the following error. org.xml.sax.SAXParseException: cvc-elt.1: Cannot find the declaration of element 'tag1'. I attached the xml document and...
2
by: pnmcosta | last post by:
Hi, I'm fairly new to XML Schema validation. We have XML being imported that must validate against the following schema: <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" ...
3
by: hardieca | last post by:
Hi, I've created an n-tier app where validation rules reside in the business layer. When a webform is saved, a business object examines its state, and if some property is invalid, throws a...
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...
8
by: Bryan | last post by:
I want my business objects to be able to do this: class Person(base): def __init__(self): self.name = None @base.validator def validate_name(self): if not self.name: return
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.