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

urgent - custom validator - ServerValidate function - problem

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?

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

please advise from your experience, i don't see how to solve this.
nothing special about the code, just setting the args.IsValid = False in the
ServerValidate function, in debug mode i see that the function is called,
what else to check?
i can't set the page.IsValid since it's read-only.
what i will point is that i'm overriding the validate method like that:

Public Overrides Sub Validate()
If bCheckSomethging Then
... update some fields.
End If

MyBase.Validate()
End Sub

but it always calls the validate method - is there a problem the way it's
written?

TIA, z.
Nov 18 '05 #1
1 2211
there are 2 properties and 1 method required to be implemented by a server
validator

two props:

ErrorMessage
IsValid

1 method

Validate

the IsValid property you implement returns validation result.

-- bruce (sqlwork.com)

"z. f." <zi**@info-scopeREMSPAM.co.il> wrote in message
news:%2****************@tk2msftngp13.phx.gbl...
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?

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

please advise from your experience, i don't see how to solve this.
nothing special about the code, just setting the args.IsValid = False in the ServerValidate function, in debug mode i see that the function is called,
what else to check?
i can't set the page.IsValid since it's read-only.
what i will point is that i'm overriding the validate method like that:

Public Overrides Sub Validate()
If bCheckSomethging Then
... update some fields.
End If

MyBase.Validate()
End Sub

but it always calls the validate method - is there a problem the way it's
written?

TIA, z.

Nov 18 '05 #2

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

Similar topics

3
by: simon | last post by:
I have 2 <asp:textbox controls>: <asp:textbox id="txt1" Runat="server" ></asp:textbox> <asp:textbox id="txt2" Runat="server" ></asp:textbox> User must insert the value either in txt1 OR in...
10
by: Rigs | last post by:
Hi, I have a textbox with a Custom Validator that utilizes the OnServerValidate method for that textbox. This works fine, however the method only executes when data exists in that textbox after...
5
by: Richard Payne | last post by:
Hi This is probably a newbie question but I can't seem to find a clear answer to the problem I have. I have created a Custom Validator control on my webform that works fine, but when I put...
9
by: Alex Shirley | last post by:
Hi there I’m simply trying to check for a blank or empty value in a textbox on my webform. In this instance I do not want to use a requiredfieldvalidator, I want to use a customvalidator (as I...
5
by: Mattyw | last post by:
Hi, I'm relatively new to Web Forms, I have been using Required Field Validators and Regular Expression Validators on a Web Form I am developing and everything works as expected using Visual...
3
by: Andy | last post by:
Hi folks, I have a customvalidator control that works properly if it isn't contained in an ASP:TABLE. But, when I place it inside an ASP:TABLE, I find that _ServerValidate doesn't get fired,...
8
by: Radu | last post by:
Hi. I have an ASP control on my page: <asp:Calendar ID="calStart" ................ Etc </asp:Calendar> and I have a Custom Validator defined as <asp:CustomValidator
2
by: tinariver | last post by:
I am using the onServerValidate of CutomValidator. I have got the Calender control and a text control. When user pick the date from calender conrol and value goes in the text box. Now I have to...
5
by: =?Utf-8?B?R2FyeSBMYXJpbWVy?= | last post by:
Created a Custom Validation Ctrl in EW2 to validate a text box entry. Want to make sure entry is evenly divisible by 7, and that value is not 0. However, args.IsValid = false, even if 77 is...
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: 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
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
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...

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.