protected void Page_Load(object sender, EventArgs e)
  {
  CheckBoxList chk = new CheckBoxList();
  form1.Controls.Add(chk);
  if (!IsPostBack)
  {
  chk.Items.Add("Hello");
  }
  }
  或者:
  protected void Page_Load(object sender, EventArgs e)
  {
  CheckBoxList chk = new CheckBoxList();
  (chk.Items as IStateManager).TrackViewState();
  if (!IsPostBack)
  {
  chk.Items.Add("Hello");
  }
  form1.Controls.Add(chk);
  }

相关文章:

  • 2021-09-26
  • 2022-12-23
  • 2021-12-18
  • 2021-12-19
  • 2022-01-19
  • 2022-02-09
  • 2022-02-09
  • 2022-01-05
猜你喜欢
  • 2021-06-04
  • 2022-12-23
  • 2021-09-02
  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2021-06-25
相关资源
相似解决方案