for the textbox if i want to allow only numbers.what ever
the characters u enter it should not take.which event u used?
Answers were Sorted based on User's Feedback
Answer / chandra sekhar
@kinjal what is the use of using compare validator here??
and with what yopu are comparing the value?? your answer is
absolutely wrong.
If we want to allow only integers into a textbox then use
"^\d{0,9}" expression.
ex: <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:RegularExpressionValidator
ID="RegularExpressionValidator1" runat="server"
ControlToValidate="TextBox1"
ErrorMessage="RegularExpressionValidator"
ValidationExpression="^\d{0,9}"></asp:RegularExpressionValidator>
Is This Answer Correct ? | 11 Yes | 1 No |
Answer / kinjal
if u r using web application then take one textbox and use comparevalidator
set properties of comparevalidator .
<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="TextBox1"
Display="Dynamic" ErrorMessage="Integer required."
Operator="DataTypeCheck" SetFocusOnError="True"
Type="Integer"></asp:CompareValidator>
Is This Answer Correct ? | 13 Yes | 10 No |
Answer / yusuf khan
You will also use ajax FilteredTextBoxExtender and in filter
type allows only number like this
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:TextBox ID="TextBox1" runat="server">
</asp:TextBox>
<asp:FilteredTextBoxExtender
ID="FilteredTextBoxExtender1" runat="server"
TargetControlID="TextBox1" FilterType="Numbers">
</asp:FilteredTextBoxExtender>
Is This Answer Correct ? | 0 Yes | 1 No |
Answer / anjaan
Three events are triggered when a key is pressed and
released:
keydown
keypress
keyup
The keydown event occurs when the key is pressed, followed
immediately by the keypress event. Then the keyup event is
generated when the key is released.
In order to understand the difference between keydown and
keypress, it is useful to understand the difference between
a "character" and a "key". A "key" is a physical button on
the computer's keyboard while a "character" is a symbol
typed by pressing a button. In theory, the keydown and
keyup events represent keys being pressed or released,
while the keypress event represents a character being typed.
Is This Answer Correct ? | 8 Yes | 10 No |
What is an anonymous method?
What is the difference between custom control and web control?
What is an Exception? How many exceptions exist in Dot net and explain them?
What are the improvements made in cas in .net 4.0?
Explain what is the difference between response.redirect & server.transfer?
Explain the two different types of typecasting?
Explain what are the deferred execution and the immediate execution in linq?
in hibernate, what is dirty reading?
Explain clr, cts and cls?
Explain the garbage collection process?
I am looking for a fast track course (MAX 15 days) in MS.NET 3.5 and SQLSERVER 2005 in hyderabad or mumbai or pune. I am working in mumbai so cannot gor for long course. Can any body suggest me the best couching class or best faculty for the same. Thanks.
which method do you use to redirect the user to another page without performing a round trip to the client? How?