【问题标题】:Default text in asp.net textbox in password mode密码模式下asp.net文本框中的默认文本
【发布时间】:2015-01-20 11:10:37
【问题描述】:

如果我有一个密码模式的 ASP 文本框,我输入的文本会被屏蔽,但我希望默认文本在文本框中显示为“密码”一词,并且当用户开始输入密码时应该被屏蔽,这可能吗?

【问题讨论】:

    标签: asp.net passwords


    【解决方案1】:

    您应该可以使用 HTML placeholder 属性来做到这一点。

    HTML

    <input type="password" name="fname" placeholder="password">
    

    ASP

    <asp:textbox placeholder="password" runat="server" />
    

    IE 10 之前的版本,需要use a placeholder polyfill 获得全面支持。

    【讨论】:

    猜你喜欢
    • 2011-12-20
    • 2011-08-30
    • 1970-01-01
    • 1970-01-01
    • 2011-08-31
    • 1970-01-01
    • 2013-12-14
    • 1970-01-01
    • 2012-01-01
    相关资源
    最近更新 更多