Author: rmdw | Posted on: 2/2/2009 5:43:25 PM | Views : 510

For some time now I've been trying to find a way to prevent a user's browser from automatically filling in a user's password.  Bank websites effectively do this but I'm not sure how.
So on my ASP.Net 2.0 Login web page I just tried adding this code:
  protected void Page_PreRender(object sender, EventArgs e)
  {
    if (!IsPostBack)
    {
      TextBox textBox = (TextBox)Login1.FindControl("Password");
      textBox.ID = Guid.NewGuid().ToString();
    }
  }
 
My idea was to artificially change the Password textbox's ID on-the-fly, thus preventing the browser from filling in the previous value.  Yet when I tested it, somehow my browser (IE7) filled it in with the past password value.  I don't understand how.
Anyhow, my primary inquiry is to find a way to eff ...

Go to the complete details ...