Click here to Skip to main content
15,892,797 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I have created dynamic text boxes.

I need to add keypress event and allow user to enter only numbers and charecter 'f' only.

I tried in this way like
txtmrks.Attributes.Add("keypress", "");

But it won't run after debug.

Please, someone help me.

Thanks in advance
Posted
Updated 10-Jan-11 23:49pm
v3
Comments
Dalek Dave 11-Jan-11 6:20am    
Edited for Readability.

I Think Answer given by Suthish HERE[^] can help you.
 
Share this answer
 
Comments
tulasiram3975 19-Jan-11 6:08am    
Thank you very much
Try adding a TextChanged event to your element in the aspx file.
 
Share this answer
 
You can always try the MaskedEdit[^] extender from the ASP.NET AJAX Control Toolkit

Regards
Espen Harlinn
 
Share this answer
 
Comments
tulasiram3975 11-Jan-11 6:16am    
i am using dynamic text boxes only i dont have knowledge of ajax
Espen Harlinn 11-Jan-11 6:24am    
If you install the toolkit, I think you will find that it will not be a problem
tulasiram3975 11-Jan-11 6:50am    
can we generate dynamically

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900