Click here to Skip to main content
15,881,092 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Is there any technique to clear remembered username and password from browser?

In MVC3

1 I have login and select option from mozilla firfox browser " remember username and password "

2 After complete functionality in restricted pages finally i have logout

3 when i re open my login window that show my username and password automatically
for that situation how can i remove those?

Please help me.
Posted

 
Share this answer
 
Comments
DGKumar 11-Sep-13 7:21am    
Thank you for respond.

in mvc3 there is no this "<form id="loginForm" action="login.cgi" method="post" autocomplete="off"></form>" type of option
then how can i add this AUTOCOMPLETE="OFF" attribute
MVC does not have server controls like plain old ASP.NET. Therefore no server processing is done on your controls. They are rendered to the client exactly how you type them. Themes are not something you will use in MVC, because they apply to ASP.NET server controls and you won't be using those here. That said, HTML helpers do get processed by the server as the view is rendered. You will need to add autocomplete="off" to the actual HTML control using the html properties overload.

@Html.TextBoxFor(x => x.Something, new { autocomplete="off" } )
Or whatever the actual HTML attribute is that gets rendered when you set autocomplete="off" in the asp.net server control.

EDIT: One option to affect all text boxes would be to create your own Html helper method. Just create an extension method Like this:

using System.Web.Mvc;
using System.Web.Mvc.Html;

public static MvcHtmlString NoAutoCompleteTextBoxFor<tmodel,>(this HtmlHelper<tmodel> html, Expression<func><tmodel,>> expression)
{
return html.TextBoxFor(expression, new { autocomplete="off" });
}
 
Share this answer
 
Comments
DGKumar 11-Sep-13 7:37am    
Still the textboxes bind automatically previous username and password as list, same as dropdownlistboxes when i click on textbox
C#
Html.BeginForm(
    action, controller, FormMethod.Post, new {autocomplete="off"})
 
Share this answer
 
Clear the browser cache

In your key board Alt+Shift+Del, will bring a popup where you can clear the cache
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900