での使い方はありautocomplete="off"
ます<asp:Login> </asp:login>
か?asp:login をテンプレートに変換し、autocomplete="off" 属性を asp:TextBox 要素に配置しようとしましたが、これによりログイン プロセスの他の部分が壊れます。JavaScript を使用せず、テンプレートに変換せずにオートコンプリートを無効にする方法はありますか。コードの背後にある可能性がある場合は問題ありません。あなたの提案を楽しみにしています。ありがとう
これがPage_Loadのコードです
if (!Page.IsPostBack)
{
var control = this.FindControlRecursive(LoginArea, "UserName") as TextBox;
if (control != null)
{
control.Attributes.Add("autocomplete", "off");
}
var control2 = this.FindControlRecursive(LoginArea, "Password") as TextBox;
if (control2 != null)
{
control2.Attributes.Add("autocomplete", "off");
}
}
そしてここにaspxページ:
<asp:Login ID="LoginArea" runat="server" SkinID="Login" CssSelectorClass="PrettyLogin"
DestinationPageUrl="Home.aspx" LoginButtonImageUrl=""
LoginButtonText="login button"
LoginButtonType="Button"
UserNameLabelText="username>"
PasswordLabelText="password"
TitleText="title"
RememberMeSet="false" DisplayRememberMe="false"
FailureText="failed"
ToolTip="tool tip"
PasswordRecoveryText=""
PasswordRecoveryUrl="urlforpasswordrecovery"
CreateUserText=""
CreateUserUrl="" OnLoggedIn="LogOn_LoggedIn"
OnLoggingIn="LogOn_LoggingIn" OnLoginError="LogOn_Error" >
</asp:Login>