Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Problem Facing in Server Side Validation.

Reply
Thread Tools

Problem Facing in Server Side Validation.

 
 
msnews.microsoft.com
Guest
Posts: n/a
 
      05-20-2005
Hi All,

I m facing problem in Server Side Validation.
For Example The Scenario is

I have two fields on the page
1 Country Dropdown List
2 Province Textbox
3 State Dropdown List

I put two validation controls on the page

1 one is RequiredFieldValidator for Province Textbox
2 second is CompareValidator for State Dropdown List

If the Country USA is selected then State should be validated whether a valid state is selected or not and Province Textbox should not validated.
If the Country other than USA is selected then Province Textbox is validated and State Dropdown List should not be validated.

But on the server when i call Page.Validate() method this validate both controls whatever is the Country is selected.
How can i disable the validation on ther server regarding of my choice.


Regards,
Muhammad Jamil Nawaz
 
Reply With Quote
 
 
 
 
msnews.microsoft.com
Guest
Posts: n/a
 
      05-20-2005
I have done it by removing the relative validator from the page.validator collection on my choice.
If any one have any other idea then please tell me

Thanks
Muhammad Jamil Nawaz
"msnews.microsoft.com" <(E-Mail Removed)> wrote in message news:(E-Mail Removed)...
Hi All,

I m facing problem in Server Side Validation.
For Example The Scenario is

I have two fields on the page
1 Country Dropdown List
2 Province Textbox
3 State Dropdown List

I put two validation controls on the page

1 one is RequiredFieldValidator for Province Textbox
2 second is CompareValidator for State Dropdown List

If the Country USA is selected then State should be validated whether a valid state is selected or not and Province Textbox should not validated.
If the Country other than USA is selected then Province Textbox is validated and State Dropdown List should not be validated.

But on the server when i call Page.Validate() method this validate both controls whatever is the Country is selected.
How can i disable the validation on ther server regarding of my choice.


Regards,
Muhammad Jamil Nawaz
 
Reply With Quote
 
 
 
 
Steve Goodyear
Guest
Posts: n/a
 
      05-21-2005
Hi Muhammad,

Removing the validator control will work or you can also set its Visible
property to false and you can also set its Enabled property to false. Either
of those would not cause a Validate event to fire during the Page.Validate.

RequiredFieldValidator1.Enabled = false;

Cheers,
Steve Goodyear
 
Reply With Quote
 
 
 
Reply

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 Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Facing problem while accessing virtual server count in Sharpeoint using SPGlobalAdmin sureshhalade@gmail.com ASP .Net Security 0 06-06-2007 09:41 AM
Problem Facing in Server Side Validation. msnews.microsoft.com ASP .Net 3 05-21-2005 04:25 PM
Problem Facing in Server Side Validation. msnews.microsoft.com ASP .Net Building Controls 2 05-21-2005 04:56 AM
Server-Side Control - Embedded Server-Side Code - Inline Mythran ASP .Net 2 01-22-2005 01:02 AM
data synchronisation - java server side or www server side? Thor Java 1 07-02-2003 05:44 PM



Advertisments