5
Answers

How to validate if text box have only special character?

Raja

Raja

8y
364
1
i want to validate the text box.this is text box contain item number availability check .if the user enters only special character like( !@#$%^&amp;+)(**)_)":}{?&gt; )throw the alert message.<br /><div> </div><div>item number : &nbsp;&nbsp; m_test-120</div> <strong>What I have tried:</strong><br /> <br /> i use <br /> <br /> Regex r = new Regex(@"[~`!@#$%^&amp;*()+=|\\{}':;.,&lt;&gt;/?[\]""_-]");<br /> if (r.IsMatch(tbxspirno.Text.ToString().Trim()))<br /> {<br /> Master.ShowMessage("Enter valid item number", MessageHelper.MessageType.Information);<br /> }
Answers (5)