if(!string.IsNullOrEmpty(tb.Text))// Note. Tb is an instance of a TextBox in your application { // Do something }
String.IsNullOrEmpty()
String.Trim().Length == 0
if(string.IsNullOrWhiteSpace(this.textBox1.Text)) { MessageBox.Show("TextBox is empty"); }
if(textBox1.Text.Equals("")) { // write the code you want }
<asp:TextBox ID="txtName" runat="server" Width="165px" required=""></asp:TextBox>
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)