为什么我使用C#在asp.net的密码字段中获取旧密码?

时间:2020-12-14 00:57:09

i am making a asp.net website where an user can change password .. by clicking a button changepassword i am redirecting to a new asp page where i have a user code field and a old password filed and a new password field like this:

我正在创建一个用户可以更改密码的asp.net网站..通过单击按钮changepassword,我将重定向到新的asp页面,其中我有一个用户代码字段和一个旧密码字段,以及一个新密码字段,如下所示:

<table width="100%">
    <tr>
        <td>
            <asp:Label ID="Label5" runat="server" Text="User Code: "></asp:Label>
        </td>
        <td>
            <asp:TextBox ID="txtusercd2" runat="server"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>
            <asp:Label ID="Label6" runat="server" Text="Enter Old Password: "></asp:Label>
        </td>
        <td>
            <asp:TextBox ID="txtoldpwd" runat="server" TextMode="Password"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>
            <asp:Label ID="Label7" runat="server" Text="Enter New Password: "></asp:Label>
        </td>
        <td>
            <asp:TextBox ID="txtnewpwd" runat="server" TextMode="Password"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>
            <asp:Label ID="Label8" runat="server" Text="Re-Enter New Password: "></asp:Label>
        </td>
        <td>
            <asp:TextBox ID="txtrepwd" runat="server"></asp:TextBox>
        </td>
    </tr>
    <tr>
        <td>
            <asp:Label ID="lblmsg2" runat="server" Text="Label"></asp:Label>
        </td>
    </tr>

    <tr>
        <td style="float:right">
            <asp:ImageButton ID="btnchngpwd" runat="server" ImageUrl="~/images/Save.png" />
        </td>
    </tr>
</table>

now the problem is when i am redirecting to that page my code filed and old password is getting populated by the user login details i dont want to populate the old password filed . what shold i do?

现在的问题是,当我重定向到该页面时,我的代码已归档,旧密码将被用户登录详细信息填充,我不想填充旧密码。我做了什么?

1 个解决方案

#1


2  

That's the webbrowser auto-populating it for you. Add the autocomplete="off" attribute to each <input /> element that is being inappropriately filled.

这是webbrowser为您自动填充它。将autocomplete =“off”属性添加到每个不适当填充的元素。

#1


2  

That's the webbrowser auto-populating it for you. Add the autocomplete="off" attribute to each <input /> element that is being inappropriately filled.

这是webbrowser为您自动填充它。将autocomplete =“off”属性添加到每个不适当填充的元素。