后台申明的lable怎么才能显示,
Label lable3 = new Label();
DateTime curTm = DateTime.Now;
DateTime endTm = Convert.ToDateTime("2010-11-7");
lable3.ForeColor = System.Drawing.Color.Red;
this.Dates.Text = (curTm - endTm).Days.ToString();
this.hour.Text = (curTm - endTm).Hours.ToString();
this.min.Text = (curTm - endTm).Minutes.ToString();
lable3.Text = (curTm - endTm).Minutes.ToString();我的lable3显示不出来
Label lable3 = new Label();
DateTime curTm = DateTime.Now;
DateTime endTm = Convert.ToDateTime("2010-11-7");
lable3.ForeColor = System.Drawing.Color.Red;
this.Dates.Text = (curTm - endTm).Days.ToString();
this.hour.Text = (curTm - endTm).Hours.ToString();
this.min.Text = (curTm - endTm).Minutes.ToString();
lable3.Text = (curTm - endTm).Minutes.ToString();我的lable3显示不出来
DateTime curTm = DateTime.Now;
DateTime endTm = Convert.ToDateTime("2010-11-7");
lable3.ForeColor = System.Drawing.Color.Red;
this.Dates.Text = (curTm - endTm).Days.ToString();
this.hour.Text = (curTm - endTm).Hours.ToString();
this.min.Text = (curTm - endTm).Minutes.ToString();
lable3.Text = (curTm - endTm).Minutes.ToString();
this.Controls.Add(lable3);还是不行,显示不出
再写代码 Label lable1 = new Label();
lable1.Text = "你好";
this.Panel1.Controls.Add(lable1);
控件加到panel里面 就OK
<asp:TextBox ID="Dates" runat="server"></asp:TextBox>
<asp:TextBox ID="hour" runat="server"></asp:TextBox>
<asp:TextBox ID="min" runat="server"></asp:TextBox>
</asp:Panel>Panel1.Controls.Add(lable3);