if (txtpassword.Text.Trim() == txt_CnfmPWD.Text.Trim())
{
// MessageBox.Show("same");
} else {
MessageBox.Show("Confirm password is not matched with password..?");
return;
}This code snippet is for how to compare two textbox values in c#.
