Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
Hi,
 
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 1:03am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

check this question
How avoid the cache of Textbox[^]
--NDK
  Permalink  
Comments
Tech Code Freak at 23-Jan-12 2:55am
   
Good link! 5up!
Rate this: bad
good
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>
  Permalink  
v2
Comments
.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)
{
designLinks();
}
 
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
good
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
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 6,569
1 Sergey Alexandrovich Kryukov 6,168
2 DamithSL 5,228
3 Manas Bhardwaj 4,717
4 Maciej Los 4,150


Advertise | Privacy | Mobile
Web03 | 2.8.1411022.1 | Last Updated 20 Jan 2012
Copyright © CodeProject, 1999-2014
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