custom validator problem

Z

z. f.

Hi,

in my custom validator ServerValidate function i set
args.IsValid = False
but the page execution continues like the page is valid and the validation
summary doesn't show the error message .

how come?

TIZ, z.
 
Z

z. f.

and how should it work, if the args parameter is passed byval?
it won't go anywhere outside of the function scope.
is this a bug in vb.net because trying to set it to byref causes compilation
error,
or i'm missing here something?

TIA.
 
D

DujHoD

I don't have enough information to know what's wrong in your specific
case, but to address your question:
how should it work, if the args parameter is passed byval?

Keep in mind that the type of args (ServerValidateEventArgs) is a
reference type, so the fact that the argument is ByVal just means that
you can't replace the object to which args points. You CAN modify the
members of the object. For more information on ByVal and reference
types, see

http://msdn.microsoft.com/library/en-us/vbcn7/html/vaconargumentpassingbyvalue.asp
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top