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

Creating a validationsummary

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, that makes use of my
messagebox to show the summary of failing validators.

So far I've been successfull achieving this. However, the serverside
nature of the MessageBox currently forces all validators (and the
validationsummary) to have EnableClientScript=false. In short this
means that all validations are made on the server, which causes
postbacks.

The validationsummary webcontrol shipped with the .net framework makes
it possible to have the validationsummary displayed in a javascript
alert-messagebox. I want to recreate the same clientside display with
my own messagebox. In short, write the messagebox to the page in a
hidden state, and show it on demand.
However, the .net valisationsummary alert is created in the included
validation-javascript file (WebUIValidation.js) wich also contains all
the functions for clientside validation so, as I see it, it's quite
impossible to both have clientsidescript enabled on validationcontrols
and summary, and still create my own clientside daisplay of the
failing validator.

Does any of you out there been in similar situations? Any ideas how to
cut my cake? I'm determined to use the existing clientside
functionality with regards to validation, by I'd like to make my own
display function.

Kind regards
Christer
Nov 18 '05 #1
3 4933
I have not undertaken this particular task, though I have called the
validation scripts by hand on several occasions. So, thinking about the
problem, there are a couple of different approaches that I can think of.

First, you could step through the client side validation scripts, and see
what methods are doing the tasks that you want. You can then build your own
script that calls into these scripts where you want to use their
functionality, but then handles the display when you want to have control.

Alternately, you know that there is an option to have these messages display
on the page instead of popping up a message box. You could use
Attributes.Add to attach an onchange event handler when the script updates
these controls, and then use the text in here to create your own popup
window.

--
Chris Jackson
Software Engineer
Microsoft MVP - Windows Client
Windows XP Associate Expert
--
More people read the newsgroups than read my email.
Reply to the newsgroup for a faster response.
(Control-G using Outlook Express)
--

"Christer" <wi******@hotmail.com> wrote in message
news:7b**************************@posting.google.c om...
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, that makes use of my
messagebox to show the summary of failing validators.

So far I've been successfull achieving this. However, the serverside
nature of the MessageBox currently forces all validators (and the
validationsummary) to have EnableClientScript=false. In short this
means that all validations are made on the server, which causes
postbacks.

The validationsummary webcontrol shipped with the .net framework makes
it possible to have the validationsummary displayed in a javascript
alert-messagebox. I want to recreate the same clientside display with
my own messagebox. In short, write the messagebox to the page in a
hidden state, and show it on demand.
However, the .net valisationsummary alert is created in the included
validation-javascript file (WebUIValidation.js) wich also contains all
the functions for clientside validation so, as I see it, it's quite
impossible to both have clientsidescript enabled on validationcontrols
and summary, and still create my own clientside daisplay of the
failing validator.

Does any of you out there been in similar situations? Any ideas how to
cut my cake? I'm determined to use the existing clientside
functionality with regards to validation, by I'd like to make my own
display function.

Kind regards
Christer

Nov 18 '05 #2
Having rewritten the entire validation framework, including
validationsummary and alert boxes, I have lots of experience here. I'd like
to know specifically what you were trying to do within the alert that
differs from Microsoft's controls? My product, "Professional Validation And
More" may help. (http://www.peterblum.com/vam/home.aspx) It provides the
ability to describe your alert box with rules to allow text before and
after, plus the format of the error messages can be in list or sentence
style. It has an extensive free Developer's Kit with the ability to extend
the client-side code for validators and validationsummary.

I suspect that to better understand what you are doing, I would have to
better understand what your MessageBox webcontrol does beyond writing the
javascript: window.alert('message');
and why you want to use it to deliver the contents of the ValidationSummary.

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

"Christer" <wi******@hotmail.com> wrote in message
news:7b**************************@posting.google.c om...
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, that makes use of my
messagebox to show the summary of failing validators.

So far I've been successfull achieving this. However, the serverside
nature of the MessageBox currently forces all validators (and the
validationsummary) to have EnableClientScript=false. In short this
means that all validations are made on the server, which causes
postbacks.

The validationsummary webcontrol shipped with the .net framework makes
it possible to have the validationsummary displayed in a javascript
alert-messagebox. I want to recreate the same clientside display with
my own messagebox. In short, write the messagebox to the page in a
hidden state, and show it on demand.
However, the .net valisationsummary alert is created in the included
validation-javascript file (WebUIValidation.js) wich also contains all
the functions for clientside validation so, as I see it, it's quite
impossible to both have clientsidescript enabled on validationcontrols
and summary, and still create my own clientside daisplay of the
failing validator.

Does any of you out there been in similar situations? Any ideas how to
cut my cake? I'm determined to use the existing clientside
functionality with regards to validation, by I'd like to make my own
display function.

Kind regards
Christer

Nov 18 '05 #3
"Peter Blum" <PL****@Blum.info> wrote in message news:<eo**************@TK2MSFTNGP10.phx.gbl>...
I suspect that to better understand what you are doing, I would have to
better understand what your MessageBox webcontrol does beyond writing the
javascript: window.alert('message');
and why you want to use it to deliver the contents of the ValidationSummary.
Well, when making our web applications we are often challanged with
where to put general returnmessages and validation summaries on a
given page, because the page contents differ.
The messagebox webcontrol actually is a close remake of the windows
forms messagebox with regards to the server side code (and button and
icon enums). It's has possibility of displaying OK/Cancel/Yes/No
buttons with corresponding serverside events, therefore making it
usable as is and as included control in other webcontrols.

On the client side the messagebox not javascript-alert-based but dhtml
oriented (which of course has it's implications). However, as these
applications are meant for intranet use only, we have no big browser
worries. The messagebox has a more (positive) impact on the user with
corresponding icons than the (IMHO) limited javascript alert, and we
can even write our own caption of the messagebox (crazy feature, huh?!
:)

In short, we're trying to show all returnmessages ("Costumer
deleted"), errors ("Database gone missing") and validationsummaries
("fill in name...") in one standardized way across all our
applications (along with other standardizing initiatives).

So, this is my motivation for trying to recreate the visual part of
the original validationsummary. As stated by another poster I cold
write my own client side script to invoke the client side validators,
but because I feel like that would be like coding against functions
which should have been abstracted to me (IMHO), I'm not sure I'll go
that way... for now...

Best personal regards
Christer

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

Nov 18 '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...
0
by: Mr. x | last post by:
Hello, I am using the validationSummary control. I have a problem, that when nothing is wrong - all fields are required, and there is a value - I still get the message of the...
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...
1
by: SMG | last post by:
Hi All. My forms has two textboxes, 1 username, 2 password. Both has requiredfield validator it works fine when there is no input in these textboxes. And the errorMsg is shown in...
1
by: Dan Sikorsky | last post by:
I'm using SmartNavigation and need to automatically scroll to the top of the page when the ValidationSummary control catches errors and displays them, so that the user can see the errors without...
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...
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: 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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
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
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
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,...

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.