Wrox Programmer Forums
|
ASP.NET 3.5 Professionals If you are an experienced ASP.NET programmer, this is the forum for your 3.5 questions. Please also see the Visual Web Developer 2008 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 3.5 Professionals section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 17th, 2010, 10:16 AM
Authorized User
 
Join Date: Jun 2009
Posts: 87
Thanks: 0
Thanked 0 Times in 0 Posts
Default Validation

I want to create a class containing all the validation logic. And also want to use that class from any webform in my web application. I have inherited 'BaseValidation' class. But how to use the various properties and methods in the 'BaseValidation' class in a effective manner. Please help me.
__________________
Happy coding...

Arnab Roy Chowdhury.
 
Old December 17th, 2010, 07:13 PM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 599
Thanks: 6
Thanked 3 Times in 3 Posts
Default

Hi,

I'm not a big fan of the built in validation and would rather write my own validation.

I've created a class file called Functions.vb and set every page in the web app to inherit this class file.

Inherits Functions

And write all of the validation that I can use throughout the app in the Functions.vb class.

Like this one:

Function StripPath(ByVal Value As String) As String
Value = Replace(Value, "/", "")
Value = Replace(Value, "|", "")
Value = Replace(Value, ">", "")
Value = Replace(Value, "<", "")
Value = Replace(Value, ":", "")
Value = Replace(Value, "*", "")
Value = Replace(Value, "?", "")
Value = Replace(Value, "'", "")
Value = Replace(Value, ",", "")
Value = Replace(Value, """", "")
Value = Replace(Value, "#", "")
Value = Replace(Value, " ", "_")
Return Value
End Function





Similar Threads
Thread Thread Starter Forum Replies Last Post
Standalone validation + web form validation morbo Struts 0 August 19th, 2008 04:02 AM
Validation in C++ code_lover C++ Programming 3 July 23rd, 2008 01:26 AM
Validation using Validation Framework kalyangvd Struts 1 January 2nd, 2008 06:53 AM
Validation g_vamsi_krish ASP.NET 1.0 and 1.1 Professional 2 January 11th, 2006 06:46 AM
Validation NiNe ASP.NET 1.x and 2.0 Application Design 1 July 5th, 2005 10:27 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.