0

I am completely dumbfounded by this. I have created many webforms and been successful with the same approach. I have seen many posts on this exchange regarding similar issues, but i haven't seen anything completely pertinent.

When I click on the Button, nothing occurs.

Does anyone know what I have missed?

My HTML and ASP markup are as follows:

<asp:Button runat="server" ID="btn_AddSystem" onclick="BtnClick_SubmitNewSystem" Text="Add" />

The C# codebehind:

   protected void Page_Load(object sender, EventArgs e)
   {
        btn_AddSystem.Click += new EventHandler(this.BtnClick_SubmitNewSystem);
   }

    protected void BtnClick_SubmitNewSystem(Object sender, EventArgs e)
    {
        try
        {
            System.Diagnostics.Debug.Write("working");
        }catch (Exception ex)
        {
            System.Diagnostics.Debug.Write(ex.Message);
        }
    }
Andy Davies
  • 1,456
  • 9
  • 13
JS1986
  • 1,920
  • 4
  • 29
  • 50

1 Answers1

1

I found the solution. Based on further investigation. My buttons are with a SimpleModal jQuery plugin which was effectively moving the buttons outside of the ASP code.

SimpleModal breaks ASP.Net Postbacks

I am happy for this post to be marked for deletion.

Community
  • 1
  • 1
JS1986
  • 1,920
  • 4
  • 29
  • 50
  • I am using jQuery Dialog and could not figure out why my OnClick code behind code was not firing... ty – JoJo Nov 14 '14 at 18:58