本文整理汇总了C#中System.Web.UI.WebControls.Table.Dispose方法的典型用法代码示例。如果您正苦于以下问题:C# Table.Dispose方法的具体用法?C# Table.Dispose怎么用?C# Table.Dispose使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Web.UI.WebControls.Table
的用法示例。
在下文中一共展示了Table.Dispose方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: InitializeControls
protected void InitializeControls() {
this.panel = new Panel();
Table table = new Table();
try {
TableRow row1, row2, row3;
TableCell cell;
table.Rows.Add(row1 = new TableRow());
table.Rows.Add(row2 = new TableRow());
table.Rows.Add(row3 = new TableRow());
// top row, left cell
cell = new TableCell();
try {
this.label = new HtmlGenericControl("label");
this.label.InnerText = LabelTextDefault;
cell.Controls.Add(this.label);
row1.Cells.Add(cell);
} catch {
cell.Dispose();
throw;
}
// top row, middle cell
cell = new TableCell();
try {
cell.Controls.Add(new InPlaceControl(this));
row1.Cells.Add(cell);
} catch {
cell.Dispose();
throw;
}
// top row, right cell
cell = new TableCell();
try {
this.loginButton = new Button();
this.loginButton.ID = this.ID + "_loginButton";
this.loginButton.Text = ButtonTextDefault;
this.loginButton.ToolTip = ButtonToolTipDefault;
this.loginButton.Click += this.LoginButton_Click;
this.loginButton.ValidationGroup = ValidationGroupDefault;
#if !Mono
this.panel.DefaultButton = this.loginButton.ID;
#endif
cell.Controls.Add(this.loginButton);
row1.Cells.Add(cell);
} catch {
cell.Dispose();
throw;
}
// middle row, left cell
row2.Cells.Add(new TableCell());
// middle row, middle cell
cell = new TableCell();
try {
cell.Style[HtmlTextWriterStyle.Color] = "gray";
cell.Style[HtmlTextWriterStyle.FontSize] = "smaller";
this.requiredValidator = new RequiredFieldValidator();
this.requiredValidator.ErrorMessage = RequiredTextDefault + RequiredTextSuffix;
this.requiredValidator.Text = RequiredTextDefault + RequiredTextSuffix;
this.requiredValidator.Display = ValidatorDisplay.Dynamic;
this.requiredValidator.ValidationGroup = ValidationGroupDefault;
cell.Controls.Add(this.requiredValidator);
this.identifierFormatValidator = new CustomValidator();
this.identifierFormatValidator.ErrorMessage = UriFormatTextDefault + RequiredTextSuffix;
this.identifierFormatValidator.Text = UriFormatTextDefault + RequiredTextSuffix;
this.identifierFormatValidator.ServerValidate += this.IdentifierFormatValidator_ServerValidate;
this.identifierFormatValidator.Enabled = UriValidatorEnabledDefault;
this.identifierFormatValidator.Display = ValidatorDisplay.Dynamic;
this.identifierFormatValidator.ValidationGroup = ValidationGroupDefault;
cell.Controls.Add(this.identifierFormatValidator);
this.errorLabel = new Label();
this.errorLabel.EnableViewState = false;
this.errorLabel.ForeColor = System.Drawing.Color.Red;
this.errorLabel.Style[HtmlTextWriterStyle.Display] = "block"; // puts it on its own line
this.errorLabel.Visible = false;
cell.Controls.Add(this.errorLabel);
this.examplePrefixLabel = new Label();
this.examplePrefixLabel.Text = ExamplePrefixDefault;
cell.Controls.Add(this.examplePrefixLabel);
cell.Controls.Add(new LiteralControl(" "));
this.exampleUrlLabel = new Label();
this.exampleUrlLabel.Font.Bold = true;
this.exampleUrlLabel.Text = ExampleUrlDefault;
cell.Controls.Add(this.exampleUrlLabel);
row2.Cells.Add(cell);
} catch {
cell.Dispose();
throw;
}
// middle row, right cell
cell = new TableCell();
try {
cell.Style[HtmlTextWriterStyle.Color] = "gray";
cell.Style[HtmlTextWriterStyle.FontSize] = "smaller";
cell.Style[HtmlTextWriterStyle.TextAlign] = "center";
//.........这里部分代码省略.........