Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional 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 February 11th, 2004, 10:28 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default Validation is not triggering

Hello,

I have a form that supports 2 "modes". I have a form with a set of labels and a set of textboxes. When the user views an item, the labels are present, and when the new button is hit, the textboxes are shown. I have custom validators and required field validators set up for some of these textboxes. At first, I thought that it may be that the validators weren't visible, which wouldn't cause them to fire, but that isn't the case (I checked it out).

They aren't triggering on the code in the add button:

Page.Validate

if ( not Page.IsValid ) then
    exit sub
end if

I had breakpoints on the code, and it never fired. What could this be from? Is there something in the page that is making them not validate? Can I trigger each validation manually per validation control?

Any help would be appreciated.

Thanks,

Brian Mains
__________________
Brian
 
Old February 11th, 2004, 10:43 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,110
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Once you click the button it posts back and I would imagine that you need to account for this. You can try something like this:

If ispostback then
 if page.isvalid then

*not tested and it doesn't come with a warranty
:)

 
Old February 11th, 2004, 02:23 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

This code only executes when I click the add button, and I turned CausesValidation off on all my buttons, so the validation doesn't get triggered incorrectly.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Triggering - cancer10 Classic ASP Databases 1 May 5th, 2007 05:15 AM
CustomValidation not triggering jacob ASP.NET 1.x and 2.0 Application Design 2 December 1st, 2005 04:31 PM
triggering a code with the update in text file nav1 VB How-To 0 March 16th, 2005 03:03 PM
using triggers for triggering email event sopranos138 Classic ASP Basics 0 December 25th, 2004 01:30 PM
Triggering a javascript function badgolfer ASP.NET 1.0 and 1.1 Basics 1 June 30th, 2004 06:31 AM





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