Thursday, March 29, 2012

Server SIde Validation Issue

Hello,

I have several client side validation controls that cause an error message to be displayed in the validation summary control.

For one control, custom control, I am required to do SERVER SIDE VALIDATION.

I have the follwing code:

protected void validatePass_ServerValidate(object source, ServerValidateEventArgs args)
{
if (txtPass.Text != "Mohit")
{ validatePass.IsValid = false;
validatePass.ErrorMessage = "Wrong Password!";
}
else validatePass.IsValid = true;

}

When I enter the wrong password though I do not see the custom control generate any error message and I do not see any error message in the summary control either.

Any assisatance would be appreciated.When the wrong password is entered and the user submits the page, in the page load event or the button click event, do a check for if(Page.IsValid)
I appreciate your response.

I am afraid that I am a newbie and will need a little bit of help here.

Can you provide some pseudo code as to what I should do and can you please make any modifications to the code I provided if necessary.

Thanks!
Let's deal with this in a single thread, yeah?

http://www.vbforums.com/showthread.php?t=491694

(Since they're related questions)

0 comments:

Post a Comment