Click here to Skip to main content
16,018,158 members
Please Sign up or sign in to vote.
1.00/5 (4 votes)
See more:
how can I do that in the c# if two textbox in values password and confirm password not same give me error. ShowMessage ('password is not the same')

please help .. I hope your are understand me!

thanks for everything ..

best regards!. .
Posted
Comments
DamithSL 10-Jul-12 13:36pm    
winform or asp.net??
Sergey Alexandrovich Kryukov 10-Jul-12 17:01pm    
You don't even consider the possibility of WPF, Silverlight, something else, do you?
--SA
DamithSL 11-Jul-12 2:01am    
:) if it is not one of above OP will give the correct one. May be my way of clarifying question is not good but final goal is achieved. see the OP's comment below.
Sergey Alexandrovich Kryukov 11-Jul-12 14:59pm    
I just do not want to encourage asking question without correct specification -- of at least this. I often deny the answer even if I can guess. Anyway, the right approach is to demand that the application type or UI library should be specified where it is relevant.
--SA
Ahmet Yön 10-Jul-12 13:41pm    
c# winform

What about:
C#
if (string.Compare(myPassword.Text, myConfirmPassword.Text) != 0)
     MessageBox("Passwords do not Match, Please Correct!");
 
Share this answer
 
C#
if (txt_pass.text == txt_confirm_pass.text)
{
// Your Logic
}
else
{
MessageBox.Show ("Password not matched.", "My Application", 
MessageBoxButtons.OKCancel, MessageBoxIcon.Asterisk);
}</script>
 
Share this answer
 
if (textbox1.text == textbox2.text)
{
// do some thing;
}
else
{
Response.write("alert('Your Passwords do not match')");
}
 
Share this answer
 
Comments
[no name] 14-Jul-12 8:56am    
Response.Write and javascript in Winforms? Really?
Arjun YK 15-Jul-12 22:08pm    
Wes Aday,
Initially the question was vague and I have considered that it must be a web application. Never means all are right all the time... Misunderstandings do happen.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900