在asp.net中向TextBox添加格式 [英] Adding a format to the TextBox in asp.net

查看:142
本文介绍了在asp.net中向TextBox添加格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要设置asp.net文本框的格式,使其仅接受以下形式的用户输入

I need to format an asp.net text box in such a way that it accepts the user input only in the form of

### - ### - ### (仅#:数字).

建议或回答.

推荐答案

MaskedEdit 可能就是您想要的.

这是上面链接中的修改示例:

Here is an modified example from the link above:

<ajaxToolkit:MaskedEditExtender
    TargetControlID="TextBox2" 
    Mask="999-999-9999" />

这篇关于在asp.net中向TextBox添加格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆