if (TextBox1.Text == Label1.Text) { //Do Something. } else { //Do Something if not equals }
TextBox.Text == Label.Text
runat="server"
if(TextBox.Text.Equals(Label.Text, StringComparison.Ordinal)) { //Values are equal } else { //Values are not equal }
//Case Insensitive Compare if (string.Compare(TextBox1.Text, Label1.Text, true) == 0) { //Matching } else { //Not Matching }
//Case Sensitive Compare if (string.Compare(TextBox1.Text, Label1.Text, false) == 0) { //Matching } else { //Not Matching }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)