本文整理汇总了C#中System.Web.UI.HtmlControls.HtmlTable.Build方法的典型用法代码示例。如果您正苦于以下问题:C# HtmlTable.Build方法的具体用法?C# HtmlTable.Build怎么用?C# HtmlTable.Build使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.HtmlControls.HtmlTable
的用法示例。
在下文中一共展示了HtmlTable.Build方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateControlHeirarchy
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);
}
示例2: CreateControlHeirarchy
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);
}
示例3: CreateControlHeirarchy
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,
//.........这里部分代码省略.........
示例4: CreateControlHeirarchy
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);
}
示例5: CreateControlHeirarchy
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);
}