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 |
Explain the difference between asp.net mvc and asp.net webforms? : asp.net mvc
How long do session variables last?
Explain Page life cycle
What are the differnt types of handler in ASP.NET?
0 Answers Sans Pareil IT Services,
What is a page life cycle? What are the events in a page life cycle?
Define the steps to set up validation control.
How many web.config files can I have in an application?
Can I tap into other windows livetm services?
Less than one page, how many windows will you be able to maintain?
Differentiate session and cookie
what is the advantage of data reader?
Explain the difference between asp & asp.net.