为什么我用
if(Session["changepage"]!=null && Session["changepage"].ToString()=="Project_Facility")
{
Company.Project_Facility sd0 = (Company.Project_Facility)this.LoadControl("Company/Project_Facility.ascx");
this.Panel1.Controls.Clear();
this.Panel1.Controls.Add(sd0);
Session["changepage"]="";
this.TreeView1.ExpandLevel=1;
}
弹出的窗口,里面的button按钮就不能响应.(不相应事件为Button1_Click)
而我用
Company.Project_Facility sd0 = (Company.Project_Facility)this.LoadControl("Company/Project_Facility.ascx");
this.Panel1.Controls.Clear();
this.Panel1.Controls.Add(sd0);
Session["changepage"]="";
this.TreeView1.ExpandLevel=1;
弹出页面,里面的button按钮就可以响应。也就是把判断的条件去掉。
if(Session["changepage"]!=null && Session["changepage"].ToString()=="Project_Facility")
{
Company.Project_Facility sd0 = (Company.Project_Facility)this.LoadControl("Company/Project_Facility.ascx");
this.Panel1.Controls.Clear();
this.Panel1.Controls.Add(sd0);
Session["changepage"]="";
this.TreeView1.ExpandLevel=1;
}
弹出的窗口,里面的button按钮就不能响应.(不相应事件为Button1_Click)
而我用
Company.Project_Facility sd0 = (Company.Project_Facility)this.LoadControl("Company/Project_Facility.ascx");
this.Panel1.Controls.Clear();
this.Panel1.Controls.Add(sd0);
Session["changepage"]="";
this.TreeView1.ExpandLevel=1;
弹出页面,里面的button按钮就可以响应。也就是把判断的条件去掉。
看看Session["changepage"]是不是"Project_Facility"
{
...; //应该是这里的语句没有执行.
}
还可以看一下session 里面的内容。 用一个try 看有没有异常发生