.NETGURU
NOT ANSWERED BEFORE: validation firing on postback - repost
Messages   Related Types
This message was discovered on ASPFriends.com 'aspng-validators' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Bryan Andrews
Is there a way to validate just a control or pane and not the whole page
when you use page.validate?

I have a second pane after a login pane, that displays a registration
form, and all the fields have already been validated and are showing the
'required' message.

I have to call validate.page because I am using an ontextchange event to
submit.

Thanks for any ideas on this.

-----Original Message-----
From: Bryan Andrews=20
Sent: Thursday, March 28, 2002 9:59 PM
To: aspngfreeforall
Subject: [aspngfreeforall] validation firing on postback

I have a form with 2 panes:

1. single login field with a on_text_change handler of:

Private Sub txtQuery_TextChanged(ByVal sender As System.Object,
=20
ByVal e As System.EventArgs) Handles txtQuery.TextChanged
Page.Validate()

If Page.IsValid Then

2. Then it hides that pane and shows the full registration form.

The full form then is showing all the validation warnings I assume
because of the Page.Validate even though that piece of the form was in a
nonvisible panel.

Is there a way not to validate the hidden panel? Thanks for any advice.

| [aspng-validators] member Click here to reveal e-mail address =3D YOUR ID
| http://www.aspfriends.com/aspfriends/aspng-validators.asp =3D =
JOIN/QUIT

Reply to this message...
 
    
Ronda (VIP)
Yes. You just need to add "causesvalidaton=false" to the controls that
you don't want to trigger validation.

Ronda

-----Original Message-----
From: Bryan Andrews [mailto:Click here to reveal e-mail address]
Sent: Wednesday, April 10, 2002 9:30 PM
To: aspng-validators
Subject: [aspng-validators] NOT ANSWERED BEFORE: [aspngfreeforall]
validation firing on postback - repost

Is there a way to validate just a control or pane and not the whole page
when you use page.validate?

I have a second pane after a login pane, that displays a registration
form, and all the fields have already been validated and are showing the
'required' message.

I have to call validate.page because I am using an ontextchange event to
submit.

Thanks for any ideas on this.

-----Original Message-----
From: Bryan Andrews
Sent: Thursday, March 28, 2002 9:59 PM
To: aspngfreeforall
Subject: [aspngfreeforall] validation firing on postback

I have a form with 2 panes:

1. single login field with a on_text_change handler of:

Private Sub txtQuery_TextChanged(ByVal sender As System.Object,

ByVal e As System.EventArgs) Handles txtQuery.TextChanged
Page.Validate()

If Page.IsValid Then

2. Then it hides that pane and shows the full registration form.

The full form then is showing all the validation warnings I assume
because of the Page.Validate even though that piece of the form was in a
nonvisible panel.

Is there a way not to validate the hidden panel? Thanks for any advice.

| [aspng-validators] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspng-validators.asp = JOIN/QUIT

| [aspng-validators] member Click here to reveal e-mail address = YOUR ID
| http://www.aspfriends.com/aspfriends/aspng-validators.asp = JOIN/QUIT

Reply to this message...
 
    
Steven A Smith (VIP)
To answer the first question,
[Original message clipped]

the answer is no. In ASP.NET v1.0 validation is only configurable at the
Page level. You cannot specify any smaller portion of the page to validate,
which is a known limitation for multi-panel "wizard"-like ASP.NET pages that
wish to use validation controls. We can hope for a more flexible validation
solution in ASP.NET 2.0...

Steve

Steven Smith, MCSE+Internet, Microsoft MVP: ASP.NET
Click here to reveal e-mail address
President, ASPAlliance.com
http://aspalliance.com The #1 ASP.NET Community
http://aspsmith.com ASP.NET Training for ASP Developers

Learning ASP.NET? Get My Book: ASP.NET By Example
http://www.amazon.com/exec/obidos/ASIN/0789725622/stevenatorasp/
----- Original Message -----
From: "Ronda" <Click here to reveal e-mail address>
To: "aspng-validators" <Click here to reveal e-mail address>
Sent: Thursday, April 11, 2002 11:41 AM
Subject: [aspng-validators] RE: NOT ANSWERED BEFORE: [aspngfreeforall]
validation firing on postback - repost

[Original message clipped]

Reply to this message...
 
    
Pedro Costa
Mate, u can activate/deactivate required fields with a javascript function like
ValidatorEnable(document.all("_ctl0_Requiredfieldvalidator1"), True); --> activates Requiredfieldvalidator1
ValidatorEnable(document.all("_ctl0_Requiredfieldvalidator1"), False); --> deactivates Requiredfieldvalidator1

hope it helps
Reply to this message...
 
 
System.EventArgs
System.Object
System.Web.UI.Page




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification