Clear auto-refill of Asp.net mvc forms

Asked

Viewed 272 times

0

I have a sign-up screen where I noticed that when the user lets the browser save the cache, when it will fill always comes a list of information that has already been typed, I would like to clear this information in a way that does not offer this typed information. Detail, I’m using Septssion, not so I couldn’t interfere.

Thanks

1 answer

0


In ASP, to prevent form caching, you can use

<% Response.CacheControl = "no-cache" %>
<% Response.AddHeader "Pragma", "no-cache" %>
<% Response.Expires = -1 %>

You can directly use the following HTML:

<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Expires" content="-1">

And also, in the form, you can include the property autocomplete="off"

  • If I use this, can all pages will not store a cache or is it better to use only on the specific page.

  • Puts the meta tags on the master page and, if not solved, puts autocomplete="off" on the form: <form autocomplete="off" name="formulario" action="minha_pagina.aspx" method="POST">

  • thanks for the help!

  • Solved your problem?

  • at the moment yes, I will test in all other browsers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.