Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 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
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 10th, 2006, 06:41 AM
Friend of Wrox
 
Join Date: Oct 2005
Location: , , United Kingdom.
Posts: 173
Thanks: 0
Thanked 2 Times in 1 Post
Default Programmatic Validation

Hi All

I wonder if anyone has tackled something similar…

I have a form which consists of several columns and several rows each cell having its own text field presented in a tabular format. What I am looking to achieve is that if a row has been part completed then for the remainder fields of that row to become requiredfield validated. Plus on the other hand if a particular row hasn’t been completed for the requiredfield validator to become disabled.

Does anyone have any ideas how I would go about this?

Many thanks

Rit
__________________
Rit
www.designandonline.co.uk
INSPIRE | CREATE | DELIVER
  #2 (permalink)  
Old May 10th, 2006, 12:30 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Rit,

I am not sure I understand the problem. Can you elaborate a bit? Maybe give an example?

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
  #3 (permalink)  
Old May 10th, 2006, 04:25 PM
Friend of Wrox
 
Join Date: Oct 2005
Location: , , United Kingdom.
Posts: 173
Thanks: 0
Thanked 2 Times in 1 Post
Default

Hi Imar

In a nutshell, is their a way of enabling/ disabling validation on individual controls depending on whether certain other controls have been inputted into.

e.g.
After selecting the submit button...

If textbox1.Text.length > 0 Then
RequiredFieldValidatortextbox2.Enable
End If

... that sort of thing in theory.

Rit
  #4 (permalink)  
Old May 11th, 2006, 01:23 AM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

In theory *and* in practice (almost)... The BaseValidator control (the the other validators inherit from) has an Enabled property.

http://msdn.microsoft.com/library/de...abledtopic.asp

You can set it to True or False, depending on the requirements.

Not sure if it applies to your situation, but you could also take a look at the ValidationGroup property: http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.basevalidator.validation group(VS.80).aspx that allows you to group validators and other controls together. This allows you to group, for example, an entire row, so a button in 1 row has no influence on validators in other rows....

HtH,

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Programmatic manipulation of a datagridview vbprowanabe Pro Visual Basic 2005 2 January 3rd, 2008 09:16 PM
Programmatic Rendering drhabi BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 July 27th, 2004 06:00 PM
Programmatic Rendering - Chapter 9 booksnore2 BOOK: Professional SQL Server Reporting Services ISBN: 0-7645-6878-7 0 July 7th, 2004 07:36 PM



All times are GMT -4. The time now is 11:43 PM.


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