本文介绍了如何制作仅接受char的masktextbox表示i​​nt和字母的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我只想在c#中编辑masktextbox的set mask属性,该属性仅使用字母和数字并将其掩码为******
表示我希望masktextbox将字母和数字显示为(星号或astreik)*
注意:-我正在将密码字段设置为被屏蔽的textbgox

请帮助
在此先感谢

i just want to edit the set mask property of a masktextbox in c# which takes only alphabets and numbers and mask it to ******
means i want a masktextbox to show alphabets and numbers as (star or astreik) *
note:- i am making a password field as masked textbgox

help please
thanks in advance

推荐答案


<div>
        <asp:scriptmanager id="ScriptManager1" runat="server" >
        </asp:scriptmanager>
        <asp:textbox id="TextBox1" runat="server" textmode="Password" xmlns:asp="#unknown"></asp:textbox>
        <asp:filteredtextboxextender id="TextBox1_FilteredTextBoxExtender">
            runat="server" Enabled="True" TargetControlID="TextBox1" 
            ValidChars="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789">
        </asp:filteredtextboxextender>
    </div>



在上面的示例中,我使用了ajax filtertexbox扩展器来根据需要添加值..
现在你的问题就解决了


注意-

1. 将文本框"文本模式更改为密码
2.像我一样将过滤器扩展器的过滤器类型属性设置为自定义..

如果有任何疑问答复

谢谢



in the above example i have used ajax filtertexbox extender to filer the value as u want..
now your problem is solve


Note-

1. Change the Textbox textmode to Password
2. set the Filter type property of filter extender to custom as i have done..

if any queries reply

thanks


<asp:RegularExpressionValidator 
ID="validator1" 
ControlToValidate="txt1"
ValidationExpression="XXX" 
Text = "Input Not Valid"
runat="server" />



XXX = ^(\ w *)



XXX = ^(\w*)


这篇关于如何制作仅接受char的masktextbox表示i​​nt和字母的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-27 14:29