可能有两个问题吧: 1 <%@...AutoWireUp=false...%> 改为AutoWireUp=true 2 sub page_load() 括号里的参数的次序不能颠倒。sender as object,e as eventargs3 最好加上 if not ispostback then ..... end if
private void InitializeComponent() { this.Load += new System.EventHandler(this.Page_Load); } 看一下是不是this.Load += new System.EventHandler(this.Page_Load);丢了
private void InitializeComponent() { this.Load += new System.EventHandler(this.Page_Load); } 看一下是不是this.Load += new System.EventHandler(this.Page_Load);丢了 ====================================================================== 这种可能性最大
private void InitializeComponent() { this.Load += new System.EventHandler(this.Page_Load); } 看一下是不是this.Load += new System.EventHandler(this.Page_Load);丢了================================= 同意,还有你有没有编译生成一下。
就如 wyfwyf2000(讨分-多多益善) 所言,"Web Form Designer generated code" 你的这句暗字体的是不是不存在了??? 它不存在也没关系,但这段代码有没有 #region Web Form Designer generated code override protected void OnInit(EventArgs e) { // // CODEGEN: This call is required by the ASP.NET Web Form Designer. // InitializeComponent(); base.OnInit(e); }
/// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary> private void InitializeComponent() { this.Load += new System.EventHandler(this.Page_Load); } #endregion
1 <%@...AutoWireUp=false...%>
改为AutoWireUp=true
2 sub page_load()
括号里的参数的次序不能颠倒。sender as object,e as eventargs3 最好加上 if not ispostback then ..... end if
{
this.Load += new System.EventHandler(this.Page_Load); }
看一下是不是this.Load += new System.EventHandler(this.Page_Load);丢了
{
this.Load += new System.EventHandler(this.Page_Load); }
看一下是不是this.Load += new System.EventHandler(this.Page_Load);丢了
======================================================================
这种可能性最大
private void InitializeComponent()
{
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: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load); }
#endregion
这样一般能发现问题如果还不行,就可以认为是你vs.net编译器的设置被你那改错了。
通过我的测试,naojin的答案最准确了!
这100分大家多少有一些!但另外的100分要给naojin(脑筋)了!
to脑筋(naojin)
迟些时候另开帖给分!