protected virtual void CreateControlHeirarchy() { HtmlTable table = new HtmlTable { CellPadding = 0, CellSpacing = 2 }; table.Build(6, 1); AreaCodeTextbox = new TextBox { ID = "AreaCodeTextbox", MaxLength = 3, Width = Unit.Pixel(50) }; table.Rows[0].Cells[1].Controls.Add(AreaCodeTextbox); FirstPhoneNumberTextbox = new TextBox { ID = "FirstPhoneNumberTextbox", MaxLength = 3, Width = Unit.Pixel(50), }; table.Rows[0].Cells[2].Controls.Add(FirstPhoneNumberTextbox); SecondPhoneNumberTextbox = new TextBox { ID = "SecondPhoneNumberTextbox", MaxLength = 4, Width = Unit.Pixel(60) }; table.Rows[0].Cells[4].Controls.Add(SecondPhoneNumberTextbox); PhoneValidator = new PhoneNumberValidator { ControlsToValidate = AreaCodeTextbox.ID + "," + FirstPhoneNumberTextbox.ID + "," + SecondPhoneNumberTextbox.ID, Condition = Cathexis.LandingPage.Behaviors.PhoneNumberValidator.Conditions.AND, Text = "*", ErrorMessage = "'Phone Number' is not valid." }; table.Rows[0].Cells[4].Controls.Add(PhoneValidator); AreaExtender = new PhoneNumberExtender { TargetControlID = AreaCodeTextbox.ID, TextChangedFunction = "ChangeTextBox('Signup_ctl34_AreaCodeTextbox','Signup_ctl34_FirstPhoneNumberTextbox','3');" }; table.Rows[0].Cells[1].Controls.Add(AreaExtender); AreaExtender = new PhoneNumberExtender { TargetControlID = FirstPhoneNumberTextbox.ID, TextChangedFunction = "ChangeTextBox('Signup_ctl34_FirstPhoneNumberTextbox','Signup_ctl34_SecondPhoneNumberTextbox','3');" }; table.Rows[0].Cells[2].Controls.Add(AreaExtender); Controls.Add(table); }
private void CreateControlHeirarchy() { HtmlTable tbl = new HtmlTable { CellSpacing = 0, CellPadding = 0 }; tbl.Build(2, 1); Controls.Add(tbl); ExpirationMonthDropdown = new DropDownList { ID = "ExpirationMonthDropDown" }; tbl.Rows[0].Cells[0].Controls.Add(ExpirationMonthDropdown); ExpirationYearDropdown = new DropDownList { ID = "ExpirationYearDropDown" }; tbl.Rows[0].Cells[1].Controls.Add(ExpirationYearDropdown); }
public virtual void CreateControlHeirarchy() { HtmlTable table = new HtmlTable(); table.Build(2, 7); Controls.Add(table); ErrorValidationSummary = new ValidationSummary { ShowSummary = false, ShowMessageBox = true }; ScriptManager sm = ScriptManager.GetCurrent(this.Page); sm.Services.Add(new ServiceReference("~/Cathexis.LandingPage.Services.StateServices.asmx")); // first table cell 2 wide table.Rows[0].Cells.RemoveAt(1); table.Rows[0].Cells[0].ColSpan = 2; table.Rows[0].Cells[0].Controls.Add(ErrorValidationSummary); FirstNameLabel = new Label { Text = "First Name:" }; table.Rows[1].Cells[0].Controls.Add(FirstNameLabel); FirstNameTextBox = new PopulatedTextBox { ID = "FirstNameTextbox", RequestVariableName = "f" }; table.Rows[1].Cells[1].Controls.Add(FirstNameTextBox); FirstNameReqValidator = new RequiredFieldValidator { ControlToValidate = FirstNameTextBox.ID, ErrorMessage = "'First Name' is not valid.", Text = "*" }; table.Rows[1].Cells[1].Controls.Add(FirstNameReqValidator); LastNameLabel = new Label { Text = "Last Name:" }; table.Rows[2].Cells[0].Controls.Add(LastNameLabel); LastNameTextBox = new PopulatedTextBox { ID = "LastNameTextBox", RequestVariableName = "l" }; table.Rows[2].Cells[1].Controls.Add(LastNameTextBox); LastNameReqValidator = new RequiredFieldValidator { ControlToValidate = LastNameTextBox.ID, ErrorMessage = "'Last Name' is not valid.", Text = "*" }; table.Rows[2].Cells[1].Controls.Add(LastNameReqValidator); StateLabel = new Label { Text = "State:" }; table.Rows[3].Cells[0].Controls.Add(StateLabel); StateDropDownList = new DropDownList { ID = "StateDropDownList" }; table.Rows[3].Cells[1].Controls.Add(StateDropDownList); StateReqValidator = new RequiredFieldValidator { ControlToValidate = StateDropDownList.ID, ErrorMessage = "'State' is not valid.", Text = "*" }; table.Rows[3].Cells[1].Controls.Add(StateReqValidator); CountryLabel = new Label { Text = "Country:" }; table.Rows[4].Cells[0].Controls.Add(CountryLabel); CountryDropDownList = new DropDownList { ID = "CountryDropDownList" }; table.Rows[4].Cells[1].Controls.Add(CountryDropDownList); CountryReqValidator = new RequiredFieldValidator { ControlToValidate = CountryDropDownList.ID, ErrorMessage = "'Country' is not valid.", Text = "*" }; table.Rows[4].Cells[1].Controls.Add(CountryReqValidator); CountryCascading = new CascadingDropDown { ID = "CountryCascading", TargetControlID = CountryDropDownList.ID, Category = "country", PromptText = "Select One", LoadingText = "Loading...", ServiceMethod = "GetCountries", ServicePath = "~/Cathexis.LandingPage.Services.StateServices.asmx" }; StateCascading = new CascadingDropDown { ID = "StateCascading", TargetControlID = StateDropDownList.ID, Category = "state", PromptText = "Select One", LoadingText = "Loading...", ServiceMethod = "GetDropDownContent", ParentControlID = CountryDropDownList.ID, ServicePath = "~/Cathexis.LandingPage.Services.StateServices.asmx" }; table.Rows[4].Cells[1].Controls.Add(CountryCascading); table.Rows[3].Cells[1].Controls.Add(StateCascading); EmailLabel = new Label { Text = "Email:" }; table.Rows[5].Cells[0].Controls.Add(EmailLabel); EmailTextBox = new PopulatedTextBox { ID = "EmailTextBox", RequestVariableName = "e" }; table.Rows[5].Cells[1].Controls.Add(EmailTextBox); EmailReqValidator = new RequiredFieldValidator { ControlToValidate = EmailTextBox.ID, ErrorMessage = "'Email' is not valid.", Text = "*" }; table.Rows[5].Cells[1].Controls.Add(EmailReqValidator); PhoneNumberLabel = new Label { Text = "Phone Number" }; table.Rows[6].Cells[0].Controls.Add(PhoneNumberLabel); PhoneNumber = new PhoneNumber(); table.Rows[6].Cells[1].Controls.Add(PhoneNumber); }
protected virtual void CreateControlHeirarchy() { HtmlTable table = new HtmlTable { CellPadding = 0, CellSpacing = 2 }; table.Build(6, 1); AreaCodeTextbox = new TextBox { ID = "AreaCodeTextbox", MaxLength = 3, Width = Unit.Pixel(50) }; table.Rows[0].Cells[1].Controls.Add(AreaCodeTextbox); FirstPhoneNumberTextbox = new TextBox { ID = "FirstPhoneNumberTextbox", MaxLength = 3, Width = Unit.Pixel(50), }; table.Rows[0].Cells[2].Controls.Add(FirstPhoneNumberTextbox); SecondPhoneNumberTextbox = new TextBox { ID = "SecondPhoneNumberTextbox", MaxLength = 4, Width = Unit.Pixel(60) }; table.Rows[0].Cells[4].Controls.Add(SecondPhoneNumberTextbox); AreaExtender = new PhoneNumberExtender { TargetControlID = AreaCodeTextbox.ID, TextChangedFunction = "ChangeTextBox('" + this.ClientID + "_" + this.AreaCodeTextbox.ClientID + "','" + this.ClientID + "_" + this.FirstPhoneNumberTextbox.ClientID + "','3');" }; table.Rows[0].Cells[1].Controls.Add(AreaExtender); AreaExtender = new PhoneNumberExtender { TargetControlID = FirstPhoneNumberTextbox.ID, TextChangedFunction = "ChangeTextBox('" + this.ClientID + "_" + this.FirstPhoneNumberTextbox.ClientID + "','" + this.ClientID + "_" + this.SecondPhoneNumberTextbox.ClientID + "','3');" }; table.Rows[0].Cells[2].Controls.Add(AreaExtender); Controls.Add(table); }
protected virtual void CreateControlHeirarchy() { HtmlTable table = new HtmlTable(); table.Build(2, 5); Controls.Add(table); CardHolderNameLabel = new Label { Text = "Cardholder Name:" }; table.Rows[0].Cells[0].Controls.Add(CardHolderNameLabel); CardHolderNameTextbox = new TextBox { ID = "CardHolderNameTextbox" }; table.Rows[0].Cells[1].Controls.Add(CardHolderNameTextbox); CardTypeLabel = new Label { Text = "Card Type:" }; table.Rows[1].Cells[0].Controls.Add(CardTypeLabel); CardTypeDropDownList = new DropDownList { ID = "CardTypeDropDownList" }; table.Rows[1].Cells[1].Controls.Add(CardTypeDropDownList); CardNumberLabel = new Label { Text = "Card Number:" }; table.Rows[2].Cells[0].Controls.Add(CardNumberLabel); CardNumberTextBox = new TextBox { ID = "CardNumberTextBox" }; table.Rows[2].Cells[1].Controls.Add(CardNumberTextBox); ExpirationDateLabel = new Label { Text = "Expiration Date:" }; table.Rows[3].Cells[0].Controls.Add(ExpirationDateLabel); CreditCardExpDate = new CreditCardExpirationDate { ID = "CreditCardExpDate" }; table.Rows[3].Cells[1].Controls.Add(CreditCardExpDate); SecurityCodeLabel = new Label { Text = "Security Code" }; table.Rows[4].Cells[0].Controls.Add(SecurityCodeLabel); SecurityCodeTextBox = new TextBox { ID = "SecurityCodeTextBox" }; table.Rows[4].Cells[1].Controls.Add(SecurityCodeTextBox); }