title: How to disable a Button in ASP.Net
body: <p>I have big problems with disabling a Button in ASP.net.
  When i disable the button on client side, the button is enabled after postback.
  When i disable the button on server side, i can't save a mask because the button is away.</p>
  
  <p>How can i fix that?
  The saving action is executed on the first Preload/PostBack.
  Meaning that the second PostBack and everything after should not do the save process.</p>
  
  <p>Also my Button is created new after every preload. How can i give this Button a fixed ID so that it is always the same object that i'm overwriting and on which i have acess.</p>
  
  <p>in .cs:</p>
  
  <pre><code>    private void AddSaveButton()
      {
          ActionButton b = new ActionButton(GetString(6025));
          b.ID = "ButtonSave";
          b.ClientInstanceName = "ButtonSave";
          b.UseSubmitBehavior = true;
          b.Click += new EventHandler(save_event);
          DivButton.Controls.Add(b);
      }
  </code></pre>
  
  <p>in aspx:</p>
  
  <pre><code> &lt;div runat="server" id="DivButton" style="margin-top: 10px; padding-bottom: 15px; float: left"&gt;
  </code></pre>
  
  <p>ActionButton:</p>
  
  <pre><code>public class ActionButton : DevExpress.Web.ASPxEditors.ASPxButton
  {
      public ActionButton(string text)
      {
          this.Text = text;
          this.CssClass = "actionButton";
          this.CssPostfix = "actionButton";
          this.AllowFocus = false;
          this.UseSubmitBehavior = false;
          this.CausesValidation = true;
      }
  }
  </code></pre>