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 |
What are the steps involved to fill a dataset?
Differentiate between Server Transfer and Response Redirect?
how to include timer or counting time to display next page in asp.net
How do you create a permanent cookie?
is it possible to set more than web.config file for an ASP.net APPLICATION?can it run?how is it possible
How to retrieve data row by row from a DataTable? Thanks In advance PriyaPP
How many webforms are possible on a single webpage?
Can i have both C# and vb.net code in same assembly?how?
Differentiate between namespace and assembly.
how we use web services
1.what is the application pool. 2.what is the HttpModile and Http Handler. 3.C# 3.0 Features ? 4.Anonoymous Type,methopd and claas in 3.0? 5.difference between statsic and const ? 6.session vs application 7.state management clint side and server side ? 8.Genric list 9.c# 3.0 vs 3.5
Hi! Could any 1 please suggest me a free practice online exam for asp.net exams.. thanks