0
bool lozinka() 
{
    int r = GridView1.Rows.Count;
    for (int i = 0; i < r; i++)
    { 
        if(DropDownList1.SelectedItem.Value==GridView1.Rows[i].Cells[2].Text)
            if (TextBox2.Text == GridView1.Rows[i].Cells[3].Text)
            {
                id = GridView1.Rows[i].Cells[2].Text;
                p = Convert.ToInt32(id);
                exit;
            }

    }
    return false;

}
protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
{
    if (lozinka())
        args.IsValid = true;
    else
        args.IsValid = false;
}

//this is the code that is error when i try to check password? when i try to log in this is custom validator for user name and password

0

1 Answer 1

1

try this

 p=convert.ToInt32(id);
    return true

instead of exit!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.