zoukankan      html  css  js  c++  java
  • How to specify a value to password , PasswordBox Control

    How to save textbox viewstate that modetype is password, Show password

    <asp:TextBox runat="server" ID="txtPassword" TextMode="Password" Value='<%#Eval("Password") %>'></asp:TextBox>

    Or

    txtPassword.Attributes.Add("Value", password);

    See  AddAttributesToRender method you can find the answer. because the control is check modetype if modetype is password
    that don't add the Attribute.

    如何让asp.net 密码框****不会消失掉。

    使用Reflector 我们可以看到它的控件会判断 Mode是不是password是的话就不把值写进来了

    我们可以自己绕过这一层用txtPassword.Attributes.Add("Value", password);这样就可以把password写进来.

    也可以自己弄一个小控件

    以下就是PasswordBox的代码

    Code

    原文地址:http://www.cnblogs.com/lovebanyi/archive/2008/10/29/1322151.html

  • 相关阅读:
    gbin1分享: jQuery UI 1.9带给我们的惊喜
    7个优秀的javascript资源
    转载:仅需78美元,你就能拥有一个iPhone机器人Romo
    GBin1推荐:使用时间轴插件Timelinr创建超酷jQuery时间轴(Time line)
    GBin1分享:10个帮助你精通Firebug控制台的技巧
    GBin1分享:jQuery1.7 Beta 预览
    批处理文件安装卸载window服务程序的技巧
    当前不会命中断点 还没有为该文档加载任何符号
    HttpModule,HttpHandler,HttpHandlerFactory简单使用
    VS2010 .net Windows服务程序 重复性 注册反注册
  • 原文地址:https://www.cnblogs.com/lovebanyi/p/1322151.html
Copyright © 2011-2022 走看看