You don't understand the concept of byval and byref.
For an object, byval means a copy of the *reference* the object is made. So
even though you have a copy of the reference, you don't have a copy of the
object. The copy of the reference to the object, still points to the same
single object. You can change where the reference copy points to - that does
not change the fact that the original reference, still points where it
pointed before.
Byref means the reference itself is passed in. Meaning, you can change where
the reference points to, and the original variable containing the reference
will now change where it points to as well.
The latter functionality is very rarely needed. Most of the time you just
care about accessing the object and its properties - and you have no need to
change where the reference points to.
Hence, things are ByVal by default, that is all you need most of the time,
and it is true for your scenario as well.
"xamman" <xa******@yahoo .comwrote in message
news:11******** **************@ a3g2000cwd.goog legroups.com...
the handler declaration:
CustomValidator 1_ServerValidat e(ByVal source As System.Object, ByVal
args As System.Web.UI.W ebControls.Serv erValidateEvent Args) Handles
CustomValidator 1.ServerValidat e
the question:
if in this sub i am to set args.IsValid to true or false depending on
my custom validator code,
why is args declared BYVAL? shouldnt it be BYREF to allow read & write?
thanks & merry christmas