如何让浏览器记住以前键入的文本框的值(usercontrol)? [英] how to make browsers to remember previously typed textbox's values (usercontrol)?
本文介绍了如何让浏览器记住以前键入的文本框的值(usercontrol)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个简单的用户控件,只是在div内部用圆角组合标签和文本框。我该怎么做才能让浏览器记住以前键入的文本框的值。我无法使AutoCompleteType属性工作。以下是控件:
I have a simple user control, just combined label and textbox inside of div with rounded corners. What should I do to make browsers to remember previously typed textbox's values. I couldn't make AutoCompleteType property working. Here is the control:
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="TextBox.ascx.cs" Inherits="UserControls.TextBox" %>
<div>
<asp:Label ID="lbl" CssClass="lbl" runat="server" Text="">
<div id="tbDiv" runat="server" class="tbRoundedWithShade">
<asp:TextBox ID="tb" runat="server" CssClass="box" ontextchanged="tb_TextChanged" AutoPostBack="false" >
</div>
<div style="display: inline-block; color: Red; visibility: hidden" runat="server" id="lblRequired" >*
我假设需要一些编程。有人有样品吗?
问候
I assume some programming will be required. Does anybody have a sample?
Regards
推荐答案
AutoComplete是一个浏览器设置。它由用户控制。
要打开这些设置,请尝试如何启用在我的浏览器中自动填充? [ ^ ]。
您可以关闭此设置或使用autoComplete
属性的单个文本框。
例如textbox1.Attributes.Add(autocomplete,off);
AutoComplete is a browser setting. It is controlled by the user.
To turn these settings on, try How do I enable Autofill in my browser?[^].
You can turn this setting off for individual text boxes by using theautoComplete
attribute.
E.g.textbox1.Attributes.Add("autocomplete", "off");
这篇关于如何让浏览器记住以前键入的文本框的值(usercontrol)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文