Friday, October 07, 2005

Custom Validation

Today I created my first custom validation:

public void TextFilled(object sender, ServerValidateEventArgs e)
{
int counter = 0;
if(DropDownList_Awards.SelectedValue.ToString() == "4" && AwardDesc.Text == "")
{
counter++;
}
e.IsValid = (counter == 0) ? true : false;
}

Hower, I made a bad error: DUH!!!!

on the Button Click event add

if (Page.IsValid)
{

}
Post a Comment