Unable to maintain the state - isvalid - in CustomValidator control.

A

Arti

Hi,

I am using ASP.NET 2.0 ; Windows XP SP3 machine.

In my web page i have made use of twocustom validator controls. Say, cv1 and
cv2
Programatically -
cv1_ServerValidate(object source,
System.Web.UI.WebControls.ServerValidateEventArgs args)

{

if(//something) { cv1.IsValid = false; }

else { cv1.IsValid = true; }

}

cv2_ServerValidate(object source,
System.Web.UI.WebControls.ServerValidateEventArgs args)

{

if(//something) { cv2.IsValid = false; }

else { cv2.IsValid = true; }

}

As i understand it, first the cv1_ServerValidate() is called then
cv2_ServerValidate()

My problem is that, though the IsValid property of cv1 control is set false,
once the process come out of this method the property value reverts back to
true. And because of this the error message is not getting displayed.

Why am I facing this problem?? Please help me with this problem.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,066
Latest member
VytoKetoReviews

Latest Threads

Top