Button does not respond to click event

J

Jeremy Ames

I am using C# to create a web form. I have got a button that I am trying to debug but the program doesn't ever stop at the event procedure for the button. Here is all of the pertinent information:

aspx file:

<asp:button id="btnEditEquipment" runat="server" CausesValidation="False" Text="Edit Equip"></asp:Button>


aspx.cs file

protected System.Web.UI.WebControls.Button btnEditEquipment;



private void InitializeComponent()

{

this.btnEditEquipment.Click += new System.EventHandler(this.btnEditEquipment_Click);

this.Load += new System.EventHandler(this.Page_Load);

}



private void btnEditEquipment_Click(object sender, System.EventArgs e)

{

// some code goes here

}
 
A

Abhijeet Dev

Check if ur button is in a <FORM runat='server'></FORM> or not.
I am using C# to create a web form. I have got a button that I am trying to debug but the program doesn't ever stop at the event procedure for the button. Here is all of the pertinent information:

aspx file:

<asp:button id="btnEditEquipment" runat="server" CausesValidation="False" Text="Edit Equip"></asp:Button>


aspx.cs file

protected System.Web.UI.WebControls.Button btnEditEquipment;



private void InitializeComponent()

{

this.btnEditEquipment.Click += new System.EventHandler(this.btnEditEquipment_Click);

this.Load += new System.EventHandler(this.Page_Load);

}



private void btnEditEquipment_Click(object sender, System.EventArgs e)

{

// some code goes here

}
 
J

Jeremy Ames

Yes. I have other controls that are working correctly.
Check if ur button is in a <FORM runat='server'></FORM> or not.
I am using C# to create a web form. I have got a button that I am trying to debug but the program doesn't ever stop at the event procedure for the button. Here is all of the pertinent information:

aspx file:

<asp:button id="btnEditEquipment" runat="server" CausesValidation="False" Text="Edit Equip"></asp:Button>


aspx.cs file

protected System.Web.UI.WebControls.Button btnEditEquipment;



private void InitializeComponent()

{

this.btnEditEquipment.Click += new System.EventHandler(this.btnEditEquipment_Click);

this.Load += new System.EventHandler(this.Page_Load);

}



private void btnEditEquipment_Click(object sender, System.EventArgs e)

{

// some code goes here

}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top