在网上找了许多相似的情况,试过了都没有用,例如: (1).CausesValidation设为"false" (2).Page_Load中添加 if (!IsPostBack) {binddata();} (3). #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.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Load += new System.EventHandler(this.Page_Load); }
#endregion (4).删了重新来过也不行 (5).页面上所有的标签的id都查过了,是唯一的。 (6).aspnet_regiis -c命令也执行了,还是不行。 注:新建一个页面,上面拖一个button控件是可以的。
override protected void OnInit(EventArgs e)
{
//
// CODEGEN:该调用是 ASP.NET Web 窗体设计器所必需的。
//
InitializeComponent();
base.OnInit(e);
} /// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器修改
/// 此方法的内容。
/// </summary>
private void InitializeComponent()
{
//可能缺少下面这句话
this.Button1.Click += new System.EventHandler(this.Button1_Click);
this.Load += new System.EventHandler(this.Page_Load); }
#endregion (4).删了重新来过也不行 (5).页面上所有的标签的id都查过了,是唯一的。 (6).aspnet_regiis -c命令也执行了,还是不行。 注:新建一个页面,上面拖一个button控件是可以的。
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
2.<form id="form1" runat="server"> 有吗?