473,512 Members | 15,363 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Custom Validator and ServerValidateEventArgs

Having a problem with ServerValidateEventArgs value when a Custom Validator
is fired. The method that is executed is very simple. Evertime it is fired
the value of ServerValidateEventArgs is always blank while debugging (the
textbox does have a value in it). The code is from a web control that is
inside another web control (aspx page that has control on it, and that
control contains the control that doesn't validate). Both controls are
using MultiViews if that matters. If I put this control and its code on a
simple aspx page (one control on an aspx page) it works fine. Any ideas?
Thanks for reading.

protected void ValidateSecurityCode(object sender, ServerValidateEventArgs
e)
{
if (_required)
{
//check to see if it has a value or not
e.IsValid = !string.IsNullOrEmpty(e.Value);
}
else
{
e.IsValid = true;
}
}

<asp:TextBox runat="server" ID="CodeTextBox" ValidationGroup="PaymentValues"
EnableViewState="false"/>
<asp:CustomValidator runat="server" ID="CodeCustomValidator"
OnServerValidate="ValidateSecurityCode"
ControlToValidate="CodeTextBox" meta:resourceKey="CodeTextBoxResource"
ValidateEmptyText="true" CssClass="formValidationErrorInline"
ForeColor="#db4242"
ValidationGroup="PaymentValues" />
Jul 2 '08 #1
0 2039

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

Similar topics

1
356
by: Sunil Sabir | last post by:
Dear All, I want to use a Custom Validator Control on a Text box which accepts only characters values. I am using the follwing procedure: Sub CustomValidator_ServerValidate(ByVal s As...
9
5142
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...
4
1582
by: Mike Moore | last post by:
Does anyone have a good example of a custom validator for max and min length validation?
8
7811
by: pmud | last post by:
Hi, I am using a compare validator in asp.net application(c# code). This Custom validator is used for comparing a value enterd by the user against the primary key in the SQL database. IF the...
1
2760
by: Elie Medeiros via .NET 247 | last post by:
Hi there, I have written a custom validator function to validate a datefrom a user-filled field. The function tries to parse the dateand if it can't, sets (serverValidateEventArgs)e.IsValid...
5
2914
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...
1
1932
by: Ben | last post by:
i'm having trouble getting a custom validator to fire on one of my webforms. i dragged a custom validator onto the form, left all the properties on default, double clicked it, and typed this in the...
0
1563
by: tsw_mik | last post by:
I have created a custom control. It has: -label -button -list of textboxes -list of dropdownlists. I want to use a custom validator to perform some validation, but somehow I can't fo it. The...
1
965
by: raghulvarma | last post by:
I have developed a custom validator to see if the name is already present in the array, if present then error message is provided.I have a textbox(TextBox1) to enter a name a button (Button1) to...
0
7153
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
7371
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,...
1
7093
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7517
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5676
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3230
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...
0
1583
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 ...
1
791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
452
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.