如何清除文本框中的缓存
问题描述:
我想知道,如果我们在文本框中键入内容,该内容会像弹出菜单一样保留在那里.我想在每次页面加载事件发生时将其清除.
我该怎么办?
有人帮助我..
i want to know,if we type something in a textbox, that remains there itself as like pop down menu.i want to clear it each time the page load event takes place.
what shall i do for this??
someone help me..
答
关闭该文本框的autocomplete
.
方法1
Turn off theautocomplete
for that textbox.
Way 1
<asp:textbox id="TextBox1" autocomplete="off" runat="server" textmode="Password" xmlns:asp="#unknown"></asp:textbox>
方法2
Way 2
document.getElementById('txtPassword').setAttribute('autocomplete','off');
Disable IE/Firefox remember password ?[^]
很好地创建存储此文本的存储(会话对象/视图状态变量).
Well create the store (session object/viewstate variable) where this text is being stored.