| Author: vasanthiraajan 08 Aug 2008 | Member Level: Gold | Rating: Points: 1 |
hi,
You can String Functions
vb.net: Strings.Trim(Textbox1.Text)
Regards, Vasanthi
|
| Author: monika choudhary 08 Aug 2008 | Member Level: Silver | Rating: Points: 4 |
use the below regular expression for spaces also u can use txtVlaue.trim();
<asp:TextBox id="txtValue2" runat="server"> </asp:TextBox>
<asp:RequiredFieldValidator id="reqField2" runat="server" ErrorMessage="The above field should not be left blank" ControlToValidate="txtValue2"> </asp:RequiredFieldValidator>
|
| Author: MANOJ MATHE 08 Aug 2008 | Member Level: Gold | Rating: Points: 5 |
HI, you can do it in 2 ways 1. Write a javscript method on button click in which you need to check the textbox value and if the value matches to space just retun false then it wnt be calling the server method
2. implement onfocus change method in javascript in which it will check the textbox value if it is space then just make the focus again to textbox.
If my approach is wrong just inform me
|