Label1.Text = "<asp:DropDownList ID=\"DropDownList1\" runat=\"server\"><asp:ListItem Value=\"0\">签到</asp:ListItem><asp:ListItem Value=\"1\">迟到</asp:ListItem><asp:ListItem Value=\"2\">旷课</asp:ListItem></asp:DropDownList>";
在后台中写的代码。
前台添加了一个label控件 但是显示不出droupdownlist。是label的text属性不能这样设置么?
在后台中写的代码。
前台添加了一个label控件 但是显示不出droupdownlist。是label的text属性不能这样设置么?
DropDownList DropDownList1=new DropDownList();
Controls.Add(droupdownlist1);才能实现添加
最好是这样,在页面上<%=字符串A%>
后台public string 字符串A;
字符串A="你要写的";