private void initLoanBatch()
{
int iCount = Convert.ToInt32(this.ddlLoanNumber.SelectedValue) + 1;
for (int i = 2; i < iCount; i++)
{
HtmlContainerControl div1 = new HtmlGenericControl();
div1.InnerHtml = "<div style='clear: both; height: 5px;'></div>";
this.divLoanBatch.Controls.Add(div1);
HtmlContainerControl div2 = new HtmlGenericControl();
div2.Style.Value = "float: left; margin-left: 3px; padding-top: 7px; width: 90px; text-align: right;";
div2.InnerHtml = "<span>第" + i + "笔放款:</span>";
this.divLoanBatch.Controls.Add(div2);
HtmlContainerControl div3 = new HtmlGenericControl();
div3.Style.Value = "float: left";
div3.Attributes.Add("class", "divColumn");
OsTextBox txtMoney = new OsTextBox();
txtMoney.ID = "txtMoney" + i.ToString();
txtMoney.CssClass = "newText";
txtMoney.Width = 150;
txtMoney.MaxLength = 11;
txtMoney.InputType = textType.FloatNumber6;
Label lb = new Label();
lb.Text = "万元";
div3.Controls.Add(txtMoney);
div3.Controls.Add(lb);
this.divLoanBatch.Controls.Add(div3);
HtmlContainerControl div4 = new HtmlGenericControl();
div4.Style.Value = "float: left; margin-left: 7px; margin-left: 7px; padding-top: 7px;width: 95px; text-align: right;";
div4.InnerHtml = "<span>提款条件:</span>";
this.divLoanBatch.Controls.Add(div4);
HtmlContainerControl div5 = new HtmlGenericControl();
div5.Style.Value = "float: left";
div5.Attributes.Add("class", "divColumn");
TextBox txtCondition = new TextBox();
txtCondition.ID = "txtDrawingTerms" + i.ToString();
txtCondition.CssClass = "newText";
txtCondition.Width = 280;
txtCondition.MaxLength = 200;
div5.Controls.Add(txtCondition);
this.divLoanBatch.Controls.Add(div5);
}
}
后台动态添加控件及设置样式
最新推荐文章于 2022-05-15 08:00:00 发布