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");