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

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 1710
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
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
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
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
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
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
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
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
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
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
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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.