在动态文本框中仅允许使用数字和'f'字符

问题描述:

大家好,

我创建了动态文本框.

我需要添加按键事件,并允许用户仅输入数字和字符"f".

我这样尝试过
txtmrks.Attributes.Add("keypress", "");

但是它不会在调试后运行.

拜托,有人帮我.

在此先感谢

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

我想由Suthish提供的答案在这里 [ ^ ]可以为您提供帮助
I Think Answer given by Suthish HERE[^] can help you.


尝试将TextChanged事件添加到aspx文件中的元素.
Try adding a TextChanged event to your element in the aspx file.


您可以随时尝试MaskedEdit [
You can always try the MaskedEdit[^] extender from the ASP.NET AJAX Control Toolkit

Regards
Espen Harlinn