Disabling postback repopulation of controls

  • Thread starter Thread starter Por Belmstedt
  • Start date Start date
P

Por Belmstedt

How do I disable postback repopulation of non-viewstate controls, such as
normal textboxes etc? (Surely there must be a more elegant solution than
manually clearing them on page load...)
 
Yes, but how does that help me? The control that is repopulated on postback
is an

<asp:TextBox Runat=server></asp:TextBox>
 
How, do you mean, is this viewstate related? The control that is
repopulated on postback is an

<asp:TextBox Runat=server></asp:TextBox>
 
In code :
Response.Cache.SetCacheability(HttpCacheability.NoCache)

Someone recently reported doing this globally, for all pages, by modifying
the global.asax.cs file, adding SetCacheability(HttpCacheability.NoCache)
in the Application_BeginRequest event.

Per page :
<%@ OutputCache Location="None" %>



Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Español
Ven, y hablemos de ASP.NET...
======================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top