PageLoad事件不执行???????? this.Load += new System.EventHandler(this.Page_Load);这句没有吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 private void Page_Load(object sender, System.EventArgs e){ // 在此处放置用户代码以初始化页面 if(!Page.IsPostBack) { InitialTreebyFormat(); }}是系统自动加的啊!! 在if(!Page.IsPostBack)添加断点就清楚怎么回事了如果if(!Page.IsPostBack)不执行的应该是缺少this.Load += new System.EventHandler(this.Page_Load); 确实是不执行,在那里添加this.Load += new System.EventHandler(this.Page_Load);?? #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。 // InitializeComponent(); base.OnInit(e); } /// <summary> /// 设计器支持所需的方法 - 不要使用代码编辑器修改 /// 此方法的内容。 /// </summary> private void InitializeComponent() { this.Load += new System.EventHandler(this.Page_Load); } #endregion 这个函数是给窗体的加载事件添加事件处理程序的,具体可查阅msdn的事件委托 把你的page_load里的代码贴一下吧,还有你调用的那个函数不应该有问题啊 请教~adRotator控件不显示图片! AspNetPager1分页组件的问题 asp.net 读取xml 问题 !!! 不同Tab中使用UpdatePanel的问题 在 2.0 类库中如何使用Server.MapPath方法~郁闷~~~ 程序如何识别文本框里的换行符? 水晶报表求救:工资报表中如何动态控制列的位置 怎么在代码中往WebConfig中写一个值? 为什么需要两次点击button按钮弹出对话框 MVC为什么不加载子对象的数据? ASP, JSP, ASP.NET有啥不同 datagrid问题
{
// 在此处放置用户代码以初始化页面
if(!Page.IsPostBack)
{
InitialTreebyFormat();
}
}
是系统自动加的啊!!
如果if(!Page.IsPostBack)不执行的应该是缺少this.Load += new System.EventHandler(this.Page_Load);
??
#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load); }
#endregion
不应该有问题啊