PoshCode Logo PowerShell Code Repository

ASPX Mailbox (2 of 6) (modification of post by view diff)
embed code: <script type="text/javascript" src="http://PoshCode.org/embed/506"></script>download | new post

This is part 2 of a 6 part mailbox creation web site.
This site allows local administrators to create and delete mailboxes, and change email addresses. Save this as MailboxTasks.aspx.cs

  1. public partial class MailboxTasks : System.Web.UI.Page
  2. {
  3.     private void Page_Load(object sender, System.EventArgs e)
  4.     {
  5.         System.Text.StringBuilder sbValid = new System.Text.StringBuilder();
  6.         sbValid.Append("if (typeof(Page_ClientValidate) == 'function') { ");
  7.         sbValid.Append("if (Page_ClientValidate() == false) { return false; }} ");
  8.         sbValid.Append("this.value = 'Please wait...';");
  9.         sbValid.Append("this.disabled = true;");
  10.         sbValid.Append("document.all.btnNext.disabled = true;");
  11.         sbValid.Append(ClientScript.GetPostBackEventReference(this.btnNext,""));
  12.         sbValid.Append(";");
  13.         this.btnNext.Attributes.Add("onclick", sbValid.ToString());
  14.         if (IsPostBack)
  15.         {
  16.             Server.Transfer("MailboxConfirm.aspx", true);
  17.         }
  18.     }
  19. }

Submit a correction or amendment below (
click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.

Syntax highlighting:


Remember me