.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal

Home >> Forum >> ASP.Net >> Post New QuestionBookmark and Share Subscribe to Forum

validation controls

Posted By: sravanthi     Posted Date: October 06, 2010    Points:2   Category :ASP.Net
i am using textbox for password. my requirement is password should be allow only characters and numbers. not allow special characters (*,&, ;, etc and not allow spaces also). using validation controls(required field validator) only i want.

Author: Murugesan G             
Posted Date: October 06, 2010     Points: 5   

U can use RegularExp Validator + RequiredField Validator or go with custom validator

Author: sravanthi             
Posted Date: October 06, 2010     Points: 5   

what code i should write. where shoud i write. i did't understand.

Author: Murugesan G             
Posted Date: October 07, 2010     Points: 5   
Author: Ramesh P             
Posted Date: October 29, 2010     Points: 5   

For that you can use required field and regular expression validators.



Author: krishana singh             
Posted Date: December 07, 2010     Points: 5   

using keypress event

private void txtmobilesecond_KeyPress(object sender, KeyPressEventArgs e)
int ascii = Convert.ToInt16(e.KeyChar);
if ((ascii >= 48 && ascii <= 58) || (ascii >= ..... && ascii <= .....))
e.Handled = false;
e.Handled = true;

..... fill character ascii value from as us wish

use this

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend