Disabling postback repopulation of controls

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...)
 
P

Por Belmstedt

Yes, but how does that help me? The control that is repopulated on postback
is an

<asp:TextBox Runat=server></asp:TextBox>
 
P

Por Belmstedt

How, do you mean, is this viewstate related? The control that is
repopulated on postback is an

<asp:TextBox Runat=server></asp:TextBox>
 
J

Juan T. Llibre

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" %>
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top