473,856 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Using Summary Validation control with server Custom validation

I setup some standard Required Field Validation controls and one Custom
validation control on an ASP.NET page (within a user control) to validate
text entry. I also setup a Summary Control to post all the messages to a
message box (ShowMessageBox =true). The required field validation error
messages show up in the summary just fine but I can't get the custom
validation message to show up if invalid.

So far I have the summary control showing the required field errors and the
custom validation message shows inline. In order to get that to work, I had
to add code to my button control to not redirect to other page if
page.isvalid = false. Is there anyway to get it to show up on the message
box? Does it have anything to do with the fact that the messagebox is client
side and the custom validation control is doing server side validation?

Thanks,
Barbara Alderton
Nov 18 '05 #1
2 3746
The alert box shown is a client-side feature that appears prior to posting
back. Your customvalidator most likely does not have any client-side code.
So it cannot contribute to the client-side message box. If you can, write
client-side code for your customvalidator . Otherwise, you will have to live
with this design.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlu m.com
Creator of "Profession al Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Barbara Alderton" <Ba************ *@discussions.m icrosoft.com> wrote in
message news:B9******** *************** ***********@mic rosoft.com...
I setup some standard Required Field Validation controls and one Custom
validation control on an ASP.NET page (within a user control) to validate
text entry. I also setup a Summary Control to post all the messages to a
message box (ShowMessageBox =true). The required field validation error
messages show up in the summary just fine but I can't get the custom
validation message to show up if invalid.

So far I have the summary control showing the required field errors and
the
custom validation message shows inline. In order to get that to work, I
had
to add code to my button control to not redirect to other page if
page.isvalid = false. Is there anyway to get it to show up on the message
box? Does it have anything to do with the fact that the messagebox is
client
side and the custom validation control is doing server side validation?

Thanks,
Barbara Alderton

Nov 18 '05 #2
Thanks for your quick response. I am using server side code because it needs
to validate the entry against Active Directory on the server. This can't be
done from client side as far as I know.

I have read numerous articles on validation controls and it is never
mentioned that the message box cannot be used for custom validation controls
that don't use client-side code but I did suspect that was the case since
message box is a client-side feature. I guess I'll have to live with the
design I'm using know.

Thanks again,
Barbara Alderton

"Peter Blum" wrote:
The alert box shown is a client-side feature that appears prior to posting
back. Your customvalidator most likely does not have any client-side code.
So it cannot contribute to the client-side message box. If you can, write
client-side code for your customvalidator . Otherwise, you will have to live
with this design.

--- Peter Blum
www.PeterBlum.com
Email: PL****@PeterBlu m.com
Creator of "Profession al Validation And More" at
http://www.peterblum.com/vam/home.aspx

"Barbara Alderton" <Ba************ *@discussions.m icrosoft.com> wrote in
message news:B9******** *************** ***********@mic rosoft.com...
I setup some standard Required Field Validation controls and one Custom
validation control on an ASP.NET page (within a user control) to validate
text entry. I also setup a Summary Control to post all the messages to a
message box (ShowMessageBox =true). The required field validation error
messages show up in the summary just fine but I can't get the custom
validation message to show up if invalid.

So far I have the summary control showing the required field errors and
the
custom validation message shows inline. In order to get that to work, I
had
to add code to my button control to not redirect to other page if
page.isvalid = false. Is there anyway to get it to show up on the message
box? Does it have anything to do with the fact that the messagebox is
client
side and the custom validation control is doing server side validation?

Thanks,
Barbara Alderton


Nov 18 '05 #3

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

Similar topics

4
2811
by: Kevin Phifer | last post by:
Ok, before anyone freaks out, I have a solution I need to create that gathers content from maybe different places. Each one can return a <form> in the html, so its the classic can't have more than one runat=server form on a asp.net page. However, I still want developers to be able to use asp.net controls to create some apps that are created on the page. So I need multiple forms on a asp.net page(doesn't everyone). I purchased the...
5
3174
by: Marcel Gelijk | last post by:
Hi, I am trying to create a User Control that is located in a seperate class library. The User Control contains a textbox and a button. The page generates an exception when it tries to access the code variable that are supposed to be linked to the contained controls. It runs fines when everything is contained in a single web form project. What do I need to do to make it work from a class library?
2
1143
by: NWx | last post by:
Hi, I have a form with few controls, few validation controls and a validation summary control I set-up appropriate Messages in Validations controls. However, if validation fails, I just want to display a * in validation control (or any other character), and instead display all validation messages in Validation summary control.
2
2418
by: Stephen Miller | last post by:
Can the CustomValidator be used to simply report unexpected errors, without requiring Client/Server validation? To explain, say you had a simple text box and button that did a Full-text Search of a Catalogue in SQL. Malformed search requests can generate a variety of errors, which I simply want to catch, set the CustomValidator's IsValid method to false and assign the ErrorMessage to the CustomValidator's Message property. For example: ...
2
2801
by: Lucas Tam | last post by:
Hi all, I want to display an error message from a custom validator in my Validation Summary control. Do I need to build the ServerValidate Event handler in order to display an error message? All I wish to do is raise an error message on a failed database insert -
2
5270
by: nmakhan | last post by:
I have a validation summary that I use soley for my Required Field Validators. That works fine if I do things that way up to a point, if by chance the validation summary says "Date field required" then I edit the date and input an incorrect date, which I have a JavaScript validation for, that message will come up saying how to enter the date. The problem is that the validation summary is now populated and it wont
4
6888
by: kpg | last post by:
I can't get the CustomValidator (CV) ErrorMessage to display in the ValidationSummary. On the same page I have several RequiredField Validators and a Range Validator, that all work just fine, that is, the ErrorMessage text is displayed by the Validation summary control. If I leave the CV Text field blank then the errormmessage does display on the CV itself.
1
2590
by: daveh551 | last post by:
I have a web page with an address entry form and some other things on it. The form has field validators on several of the fields, and a validation summary at the bottom. Because of the size of the form, on a typical screen, you need to scroll to see the bottom of the form, which is where the validation summary is. So when a user presses submit, and gets a validation error, the screen redisplays, but it redisplays from the top with...
0
9903
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
11048
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10770
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7928
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7084
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5754
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5954
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4567
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 we have to send another system
2
4168
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.