How to Stop a Page From Flickering on Postback
By Timothy James
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.
References
Writer Bio
Timothy James is a business litigation attorney licensed to practice law in California. He is also a programmer and website developer specializing in C++, JavaScript/JQuery, HTML, CSS and several other languages. James holds a Juris Doctor, as well as a Bachelor of Science in planning and resource management. He has written about law, health, programming, culture, news and politics.