How to use <= symbol in asp.net c# with Label
else if (lbType.Text <= "9") { Response.Write("<script language='javascript'>alert('Please Input Bale Barcode');</script>"); }
Error: operator cannot be applied to operands of type string and string
In order to compare you need to convert the label text to integer and then compare with integer value.
else if (Convert.ToInt32(lbType.Text) <= 9) { Response.Write("<script language='javascript'>alert('Please Input Bale Barcode');</script>"); }
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.