首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > .NET >

服务器无法在发送http标头之后修改cookie-ajax asp.net控件应用报错.

2014-01-28 
后台cs:protected void Page_Load(object sender, EventArgs e) {ArrayList alif (Session[Controls] !

后台cs: 
protected void Page_Load(object sender, EventArgs e)
{
  ArrayList al;
  if (Session["Controls"] != null)
  {
  al = (ArrayList)Session["Controls"];
  PH.Controls.Clear();
  for (int i = 0; i < al.Count; i++)
  {
  DropDownList ddl = (DropDownList)al[i];
  ddl.SelectedIndexChanged += new EventHandler(dl_SelectedIndexChanged);
  PH.Controls.Add(ddl);
  }
  }
  if (!IsPostBack)
  {
  DataTable dtbl11 = limitedTree.LoadAllrootCategory(out strError);
  CreateControls(dtbl11, 0);
}

void CreateControls(DataTable dtbl, int CurID)
{
  ArrayList al;

  if (Session["Controls"] == null)
  al = new ArrayList();
  else
  {
  al = (ArrayList)Session["Controls"];
  for (int i = 0; i < al.Count; i++)
  {
  DropDownList ddl_Remove = (DropDownList)al[i];
  if (Convert.ToInt32(ddl_Remove.ID) > CurID)
  {
  i--;
  al.Remove(ddl_Remove);
  PH.Controls.Remove(ddl_Remove);
  }
  }
  }


  if (dtbl.Rows.Count > 0)
  {
  DropDownList dl = new DropDownList();
  CurID++;
  dl.ID = CurID.ToString();
  dl.AutoPostBack = true;
  dl.SelectedIndexChanged += new EventHandler(dl_SelectedIndexChanged);         

热点排行