The following example overrides the Control.Render method. It uses the Page property to access the Page.IsPostBack property and determine whether the page that contains this control has just been loaded for the first time or is the result of a postback.
protectedoverridevoid Render(HtmlTextWriter output)
output.Write("Welcome to Control Development!<br>");
// Test if the page is loaded for the first time if (!Page.IsPostBack)
output.Write("Page has just been loaded");
output.Write("Postback has occured");
Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)