Click here to Skip to main content
11,701,616 members (68,991 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: ASP.NET

How to avoid caching of TextBox(Password) even user press RefreshButton(F5)
I've a Login form user control which is being used into two pages if a user login from one page then it should display "Logged In" even in second page and also if a user clicks on sign out button from Second page then it should also logged out from First page. But if i press Refresh button of First Page then again not letting that user to sign out.
Posted 20-Jan-12 0:03am
Rate this: bad
Please Sign up or sign in to vote.

Solution 3

check this question
How avoid the cache of Textbox[^]
Tech Code Freak at 23-Jan-12 2:55am
Good link! 5up!
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

Use this
<asp:textbox textmode="Password" id="txtPassword" runat="server" width="125px" autocompletetype="None" autocomplete="False" ></asp:textbox>
.NET- India at 20-Jan-12 6:17am
Here is my code

<asp:HiddenField ID="hidPassword" runat="server" />
<asp:TextBox ID="txtName" runat="server">

<asp:TextBox ID="txtPassword" TextMode="Password" autocompletetype="None" autocomplete="False" runat="server">

<asp:Button ID="btnClick" Text="Click" runat="server" OnClick="btnClick_Click" />
<asp:Button ID="btnRefresh" Text="Refresh" runat="server" OnClick="btnRefresh_Click" />

protected void Page_Load(object sender, EventArgs e)

public void designLinks()
Response.Write(txtName.Text + "," + txtPassword.Text);
Tech Code Freak at 20-Jan-12 6:39am
Edited question to remove ----> xmlns="#unknown"
.NET- India at 20-Jan-12 6:45am
still not working....
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

when u refresh the page your page being submited again,
do one thing you add attibute

like txtPassword.attrbute.add("value","") after login

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 324
1 Maciej Los 275
2 Sergey Alexandrovich Kryukov 250
3 Mika Wendelius 189
4 CHill60 110
0 OriginalGriff 8,274
1 Sergey Alexandrovich Kryukov 7,317
2 CPallini 4,912
3 Maciej Los 4,146
4 Mika Wendelius 3,556

Advertise | Privacy | Mobile
Web01 | 2.8.150819.1 | Last Updated 20 Jan 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100