protected override void OnPreRenderComplete(EventArgs e) { if (!Page.IsPostBack) { double price0 = double.Parse(WebFrame.Designer.JStrInfoBU.GetStrTextByID("基本硬座费率")); DataTable dt1 = Data1.GetListData(); int i = 1; foreach (DataRow dr in dt1.Rows) { TextBox t1 = Rate1.Parent.FindControl("Rate" + i) as TextBox; if (t1 != null) { t1.Text = dr["Rate"].ToString().Trim(); } Label lab1 = Price1.Parent.FindControl("Price" + i) as Label; if (lab1 != null) { double v1 = Math.Round(price0 * double.Parse(dr["Rate"].ToString().Trim()) / 100, 5); lab1.Text = String.Format("{0:0.00000}", v1); } TextBox t2 = Person1.Parent.FindControl("Person" + i) as TextBox; if (t2 != null) { t2.Text = dr["PCount"].ToString().Trim(); } i++; } } base.OnPreRenderComplete(e); }