title: Using update panel to prevent postback of RadUpload Control
body: <p>I am trying to use a RadUpload Control, however, on any button click the page postbacks. To get around this I am trying to use a updatePanel and placing the button in the updatePanel, so that only a partial postback occurs.  The reason for this is that the RadUpload Control loses it's value on postback.  I am dynamically creating all the controls, and being a beginner to asp.net and C# this is tricky for me.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>Button aButton = new Button();
  aButton.ID = newControls[1].ID + "_Button";
  aButton.Click += new EventHandler(aButton_Click);
  aButton.UseSubmitBehavior = false;
  
  AsyncPostBackTrigger trigger = new AsyncPostBackTrigger();
  trigger.ControlID = aButton.ID;
  trigger.EventName = "Click";
  
  UpdatePanel container = new UpdatePanel();
  container.ID = newControls[1].ID + "_Container";
  container.ChildrenAsTriggers = true;
  container.UpdateMode = UpdatePanelUpdateMode.Conditional;
  container.Triggers.Add(trigger);
  container.ContentTemplateContainer.Controls.Add(aButton);
  
  tcControl.Controls.Add(container);
  
  static void aButton_Click(object sender, EventArgs e)
  {
      // Do Something
  }
  </code></pre>
  
  <p>I know i'm probably doing something very wrong haha, but any advice would be great. Thanks!</p>