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


Top 5 Contributors of the Month
david stephan

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
hi
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.

Responses
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.

Regards,


Ramesh

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;
}
else
{
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
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

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