views:

270

answers:

1

if user entered "!" "?" "," in textbox and press button, this person see ERROR message in label. how can make that? and what is the code?

+3  A: 

in the button click handler do:

if (textbox.text.contains("!") || textbox.text.contains("?") || textbox.text.contains(",")){
     //display error message code
     label.text = "ERROR";
}
derek
thx derek......
ilkdrl