Click here to Skip to main content
15,891,253 members
Please Sign up or sign in to vote.
2.50/5 (2 votes)
See more:
Hi,

My application is having 10 textboxes and 10 buttons,

for each textbox one button.
enter the data in textbox press button .

so validate that textbox .how to do

in previous application i wrote validate, validating events ,in that appl only one button so it worked,

but now when i enter data in first textbox click corresponding button , then other textboxes r not satisfying the condition so they r giving error.

how to solve it.
Posted
Updated 17-Apr-14 19:11pm
v2

BY KEEPING if -else in button click event
 
Share this answer
 
just validate textbox with relative button like this.. :)

C#
public void btnSave_Click(object sender,EventArgs e)
  {

      if (txtNumber.Text != "" || txtNumber.Text != string.Empty)
      {


      }
      else
      {

          MessagBox.Show("Please enter Number...!!! ");
      }

  }
 
Share this answer
 
Comments
Member 10263519 18-Apr-14 1:39am    
thanks for reply, i was solved it in the same way

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