How to validate only which is visible in asp.net

1.3k Views Asked by At

In my asp.net I am showing & hiding fields using css display:block & display:none

Now when I call Page.Validate() in my c# code, it validates all the fields and not only visible fields.

Well I know that I can do it by using "Visible=false" ot "Visible=true".

But problem is if it is visible= false then radajaxmanager cant find it & script dont work.

So how can I validate only fields which are visible & not all fields.

2

There are 2 best solutions below

0
On

Use this function in JavaScript to enable and disable the validation.

 ValidatorEnable(validatorid, true/false);

It works only if use display:none not for visible=false

0
On

You can use the property visible="true" or "false" check the link of Rahul Nikate in the comments