Server-side form validation strategy....

This is a discussion on "Server-side form validation strategy...." within the ASP.NET Forum section. This forum, and the thread "Server-side form validation strategy.... are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > ASP.NET Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jun 1st, 2007, 15:25
Junior Member
Join Date: Apr 2007
Location: Florida
Age: 40
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Server-side form validation strategy....

Hey Folks:

I need to build a class or set of classes that will perform some server-side validation of a form in such a way that users of the form would simply have to add some user controls to the form, set some properties for the user controls, then call one ValidateForm method in a validation class to validate all of the user controls at once.

The idea I have so far is as follows:

1. For each type of control (checkbox, textbox, etc) I will have a user control, that will contain the control, any validation controls like required validators or regex validators, and also a label to output the result of any server side validation.
2. The user control will have properties that specify what type of server validation needs to be performed. For example, if the user control is for a textbox, there maybe a property called CheckAddress, so that it will check a database table for the existince of that the address in the database. This is just one example.

3. The User control will have a ServerValidate method, that will check it's corresdonding properties to determine what to validate, and then do so, returning an error or not depending on success or failure.

4. The page will then simply need to add the appropriate user controls, and set the correct properties depending on what should be validated.

My dilemna is the following - I need an easy way for the page to trigger the server validation of the controls on the page. What I would like is to be able to pass the user controls to my validation class on submission of the form, then have my class iterate through all of the user controls on the page and call each corresponding ServerValidate method. I am a little stumped on a good way of doing this - since I would like my validation class to handling the iteration but it does not have access to the user control objects, so what do I pass it and how does it determine which user control it is looking at so as to call the right method?

Thanks to anyone with any input on this - a little code snippet would be great if anyone has done this before

Thanks,

John Ginzo
GinzoTech Solutions
www.ginzotech.com
Reply With Quote

Reply

Tags
form, server side validation, validation

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Java server side technologies asim Webforumz Cafe 0 Jun 20th, 2007 07:47
Trouble with Server Side Includes BGarner Classic ASP 3 Jan 20th, 2007 17:16
Server side executables Donny Bahama PHP Forum 4 Dec 30th, 2006 17:59
Using CSS Rule together with CSS Class in server side controls Polly Anna Web Page Design 6 Aug 3rd, 2006 14:20
Client-Side VS Server Side Scripting redev2006 JavaScript Forum 1 Jul 30th, 2005 19:30


All times are GMT. The time now is 06:27.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43