i have a register form & in that form i have a 2 textboxes
for entering name&age.my doubt is that how can i provide
error message like "invalid entry" when user enter a
invalid name/age(eg:user enter name as #%%%##daff,and age
as 1000.)in that textboxes.I want code.
Answers were Sorted based on User's Feedback
Answer / saravanakumar
We can use RegularExpressionValidator to validate the textbox content.
| Is This Answer Correct ? | 2 Yes | 0 No |
Answer / rajeev kumar varshney
char[] SpecialChars = "#%".ToCharArray();
string text=TextBox1.Text;
int indexOf = text.IndexOfAny(SpecialChars);
if(indexOf != -1)
{
Page.ClientScript.RegisterStartupScript("this.getType(),"a","<script>alert('Please do not enter % or # in name');</script>");
}
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / satheshkumar
name textbox should follow the reqularexpersion valitator and age textbox should follow the range validator
| Is This Answer Correct ? | 0 Yes | 0 No |
How many types is controls is there in Asp.Net?If it means what are types of custom controls?Explain about user controls,Web server controls,Hrml server controls?
What is pre-init event in ASP.NET 2.0 page life cycle?
How many types of cookies are available in asp?
Who can consume WebAPI?
What is the use of asp.net web api?
What is tracing? Where is it used?
How would you enable impersonation in the web.config file?
Define an assembly?
Can you explain how ASP.NET application life cycle and page life cycle events fire?
Explain what does wsdl stand for?
Can more than one person use the same login?
How to identify host of my system? How to identify servername of my system? How to identify domainname of my system?
Visual Basic (800)
C Sharp (3816)
ASP.NET (3180)
VB.NET (461)
COM+ (79)
ADO.NET (717)
IIS (369)
MTS (11)
Crystal Reports (81)
BizTalk (89)
Dot Net (2435)
Exchange Server (362)
SharePoint (720)
WCF (340)
MS Office Microsoft (6963)
LINQ Language-Integrated Query (317)
WPF (371)
TypeScript (144)
Microsoft Related AllOther (311)