protected void Button2_Click(object sender, EventArgs e) { try { Label13.Visible = false; ServiceReference1.Service1Client obj1 = new ServiceReference1.Service1Client(); bool result = obj1.passwordValidate(TextBox2.Text); if (result == true) Label13.Text = "Valid"; else Label13.Text = "Invalid"; Label13.Visible = true; } catch { Label13.Text = "Invalid"; } }