Click here to Skip to main content
11,576,060 members (53,989 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 Sergey Alexandrovich Kryukov 295
1 F-ES Sitecore 140
2 OriginalGriff 125
3 Dave Kreskowiak 80
4 Abhinav S 78
0 OriginalGriff 705
1 Sergey Alexandrovich Kryukov 630
2 Abhinav S 438
3 F-ES Sitecore 410
4 Suvendu Shekhar Giri 365

Advertise | Privacy | Mobile
Web03 | 2.8.150603.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