• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 377
  • Last Modified:

Selectively turn on/turn off autocomplete functionality using ASP.NET based on userId

Using ASP.NET (1.1. framework).  Needed to turn off or turn on autocomplete login functionality based on the userid/for certain users.   So if autocomplete is on, you should get that 'do you want IE to remember this password ..' message.  Am using regular server-side ASP.NET textboxes (for userid and password).

Users whose autocomplate be turned off -  i) Whose 1st 3 characters of loginid = 'foo' ii) Need to make a database call to the User table and check for a certain field (server-side logic).

Guessing this has to be done on client-side, as that autocomplete message shows up, as soon as you click on the login button. Any ideas ?
0
tapdev72
Asked:
tapdev72
  • 3
2 Solutions
 
muhammadyasirCommented:
use cookies.
0
 
Jens FiedererTest Developer/ValidatorCommented:
The  'do you want IE to remember this password ..'  is a feature of the browser, not any of your code.

The user can control this setting by, for example on IE8, using Tools | Internet Options  | Content | AutoComplete.

This is not under your control as an ASP.NET programmer.  If these are users that are under your complete control, you might be able to force them to run something on their computers that forces this setting.

Alternatively, as muhammad suggested, you can implement similar functionality yourself in ASP.NET, using cookies.  The first time your user logs on, if he is one of those you want to "autocomplete", you store the username in a cookie on his client  (or some key information that allows you to retrieve it).  On subsequent calls to your page, fill in the loginid with the value you found in (or derived from) the cookie before sending it to the user.
0
 
tapdev72Author Commented:
Some code sample would have been nice. I was expecting a solution from some expert, making an xmlhttp call in .NET 1.1. Only 2 people responded.
0
 
Jens FiedererTest Developer/ValidatorCommented:
The simple answer to your question is just "It's impossible."  

We were suggesting alternate approaches.  Code samples aren't very relevant until an approach has been decided on.
0
 
Jens FiedererTest Developer/ValidatorCommented:
(It's impossible, that is, to turn on BROWSER'S autocomplete functionality, which is what the original question sounded like - you can certainly provide your own - and although now it sounds you were hoping for an AJAX approach, you didn't tell us that - sometimes you have to respond to clarify your request before you accept an answer)
0

Featured Post

The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now