Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
How to check the textbox empty using standared function
Posted
Comments
Jameel VM 7-Mar-13 1:08am    
standard fuction means? through client side or server side?

If you are looking for Server side function then you can use this to solve you problem.

string.IsNullOrEmpty();

Happy Coding :)
 
Share this answer
 
you can also use the following code

C#
if (textBox1.Text ==  DBNull.Value.ToString())
            {
                your message
            }
 
Share this answer
 
by using jQuery you can do like this....
$("#btnSubmit").Click(function(){
   var textboxstring = $("#textboxId").text;
   if(textboxstring == "")
   {
      alert("text box in empty");
   }
});
 
Share this answer
 
You can check through Server Side like this :

if(string.IsNullOrEmpty(textbox1.Text))
{

}


or use the Javascript function to validate the textbox
 
Share this answer
 

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