473,503 Members | 2,698 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Inject items in ValidationSummary control?

First, a little background. I'm trying to forge ahead into ASP.NET 2.0.
I've dome many assemblies in C#, but I've yet to have to use ASP.NET.
I'm trying to forge ahead in getting some web/server controls created so
during a future conversion the work is already done for other programmers.

I've started created common controls used in various ecommerce
checkouts. For example, credit card validation, promo vcodes validation,
etc. Some sites use both, some sites use one. In ever case, they all
just do the right thing because their validation error messages go into
a ValidationSummary control. This is all well and good for server side
validation.

However, even if the server side validates user input, the backend
systems may still throw up errors about the data the user entered...like
the promo code has expired, the credit card is a private lable and has
options, etc, etc.
What I would like to do is inject those returned errors back into the
ValidationSummary component since they will be displayed the same way,
and the Page.IsValid would be True at that point. I have no clue where
to begin with such a task and am looking for pointers to the approach.

There could be in excess of 20 errors returned, so I didn't want to
create local validators that simply checked the return codes.

Any ideas?

Thanks,
-=Chris
Jul 25 '05 #1
3 1718
Jan
use a System.Web.UI.WebControls.CustomValidator and place your server
side validation code in the ServerValidate handler.

The client side validation checks will all be done first and if they
all pass the page will post back at which point the CustomValidators
will be run.

Hope that helps,

Jan

Jul 25 '05 #2
Jan wrote:
use a System.Web.UI.WebControls.CustomValidator and place your server
side validation code in the ServerValidate handler.

The client side validation checks will all be done first and if they
all pass the page will post back at which point the CustomValidators
will be run.

Hope that helps,

Jan

I'm already using CustomValidators. The problem is, if I use 1
CustomValidator to validate data with the backend system, I need to
stuff many different ErrorMessages into the ValidationSummary, not just
the single ErrorMessage for that CustomValidator. Even if I stuff
multiple LI HTML into the ErrorMessage property, it gets wrapped in a
single LI during Render.

-=Chris
Jul 25 '05 #3
Jan
Ah I see,

Well just create a class with a static boolean attribute that stores
it's data in Session[...] like ValidationFailed.

When you start processing the serverside validators set it false;
Then set it true if a custom validator fails.
And make sure that each validator only runs if ValidationFailed is
false

Hope that helps

Jul 26 '05 #4

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

Similar topics

0
378
by: newusertodotnet | last post by:
I'm trying to add a ValidationSummary control to a common base page used by all of our system's aspx/ascx files. The base page is a regular class file that inherits from System.Web.UI.Page. When I...
0
1975
by: John Mabbott | last post by:
Hello all, We're getting some weird behavior with the ValidationSummary control. If I submit a page that fires some validators, the ValidationSummary displays them correctly. However, if I...
3
4940
by: Christer | last post by:
Hi all! I recently created a MessageBox webcontrol for asp.net. This can be used as is, but I also want to take ude of it in other webcontrols. Right now i creating a ValidationSummary control,...
2
2422
by: Sunil Sabir | last post by:
Dear All, I am using ValidationSummary,RequiredField Validator and Regular Expression Validator in my ASP.net form. I want to display error messages only in the ValidationSummary Control. But...
5
3658
by: john.livermore | last post by:
I am successfully using the client side validation controls, but there are a couple aspects of their behavior that I wish to modify. I cannot see how to accomplish this through the properties, but...
1
3905
by: Ken Varn | last post by:
If a page has multiple ValidationSummary controls, how does it distinguish which ValidationControls are associated with which ValidationSummary controls? The reason I am asking this is that I...
3
306
by: Christopher H. Laco | last post by:
First, a little background. I'm trying to forge ahead into ASP.NET 2.0. I've dome many assemblies in C#, but I've yet to have to use ASP.NET. I'm trying to forge ahead in getting some web/server...
2
6258
by: c676228 | last post by:
Hi, I have several user controls like email, phone,ssn etc. each has it's own validation message in its user control already. When I bring all those user controls in an aspx page, I would like to...
2
1790
by: Code Rodent | last post by:
Hi there, Please please could someone shed some like on a problem that I'm having using a combination of Wizards, ValidationGroups and ValidationSummary controls. What I want to do is to have a...
0
7192
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
7064
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
7261
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
6974
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
7445
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
4665
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...
0
3158
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
3147
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
721
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.