How to Stop a Page From Flickering on Postback

By Timothy James

When a web page flickers unnecessarily, it annoys users.
i Hemera Technologies/AbleStock.com/Getty Images

Asp.Net programmers use the term "postback" to refer to a page refresh that accesses the server. A page momentarily flickers during postback because the user's browser momentarily wipes the page clean before rendering the newly received content. Microsoft, recognizing this problem, provides programmers with several methods of eliminating flickering during postback, including its Ajax framework. Ajax, or Asynchronous Javascript and Xml, eliminates flickering by limiting postbacks to only the portion of the page requesting data.

Step 1

Open the file that contains the flickering Web page in Visual Studio (see References 1, pages 1602 - 1607).

Step 2

Add a ScriptManager control to the page.

Step 3

Enclose content that you wish to update through a postback within an UpdatePanel control. Set the UpdatePanel control's ID to "UDP1" and set its "Runat" property to "Server."

Step 4

Set the properties of controls nested within the UpdatePanel. Enclose both user-responsive controls and data controls within the same UpdatePanel.

Step 5

Save your work and run the Web page. Interact with the page's user controls to ensure that they don't cause the page to flicker following a postback.

×