passwordbox - Display password char * in the password column in gridview in edit mode -


i have webform gridview. in 1 columns password. want allow users change password. there few issues.

in edit template have mentioned password column textmode password. shows blank when click on edit button.

when click on edit mode password column should display password mask characters '*' , if user changes password should updated on database.

using sha1 encryption password think can retrive password value db , keep on frontpage won't security issue.

finally found solution issue jquery.
may useful someone.

        <asp:templatefield headertext="password">             <edititemtemplate>                  <asp:textbox id="txtpassword" runat="server" width="98%"                     textmode="password" maxlength="50" text='<%# bind("userpassword") %>' cssclass="blankpassword"></asp:textbox>                 <asp:requiredfieldvalidator id="rfvpassword" runat="server" errormessage="required"                     display="dynamic" controltovalidate="txtpassword" validationgroup="saving" cssclass="requiredvalidationmessage"></asp:requiredfieldvalidator>             </edititemtemplate>             <itemtemplate>                 <asp:label id="lblpassword" runat="server" text='*****'></asp:label>             </itemtemplate>             <footertemplate>                     <asp:textbox id="txtnewpassword" runat="server" text='<%# bind("userpassword") %>' width="95%"                         textmode="password" maxlength="50"></asp:textbox>                     <asp:requiredfieldvalidator id="rfvnewpassword" runat="server" errormessage="required"                         display="dynamic" controltovalidate="txtnewpassword" validationgroup="adding" cssclass="requiredvalidationmessage"></asp:requiredfieldvalidator>             </footertemplate>             <itemstyle width="30%" />         </asp:templatefield>          <script type="text/javascript" language="javascript" charset="utf-8">         $(document).ready(function() {              $(function() {                 $("input[id$='txtpassword']").live("click", function() {                 $tb = $(this);                     $("#passwordedited").val("true");                     $tb.val("");                                         })             });             $(function() {                 $(".blankpassword").each(function() {                     $tb = $(this);                     $tb.val('*****');                     $tb.removeclass("blankpassword");                 })             });         }); </script> 

Comments

Popular posts from this blog

c# - SharpSVN - How to get the previous revision? -

c++ - Is it possible to compile a VST on linux? -

url - Querystring manipulation of email Address in PHP -