title: C#: Dynamic user Control IsPostback returning true event though the UC is loaded the first time
body: <p>I have a Page with a Dynamic User Control in a placeholder.
  When I load the Page it loads a UC ( let's call it "OrigUC" ) by default. On this page I have a button , which replaced the UC with another "NewUC" . So this button postback using ajax and replaces the UC .</p>
  
  <p>In the NewUC, In my Page_Load, I check for IsPostBack(), but for some reason, even though I loaded the UC for the first time it still returns me true. Why is it returning true, I thought the IsPostBack will return whether the UC since I'm checking it inside the Page_Load of the UC .Am I missing something?</p>
  
  <p>Ok I now understand more the IsPostback on a user control coming from the Page it is called from... So how can I determine if it is the first time the UC is being called from the page?</p>
  
  <p>Example: </p>
  
  <p>If it is the first time the UC is called within the page, I need to querythe  DB and also external WebS and bind the controls on the UC. If I trigger a partial postback , I do not want to query the DB and WebS again.</p>
  
  <pre><code>If (!IsUserControlPostBack) 
  { 
  // Step 1 Init of UC 
  // Call to DB 
  // Call to WebS 
  } 
  else 
  { 
  // A Post back occured ...  
  // It can be Page who triggered it or UC and I do not want to call Step 1 again 
  // DO something else. 
  }
  </code></pre>
  
  <p>C</p>