I know there already exist a thread for the same question but it didn't help me fix it (I tried what they suggested) anyways here is the html side of the button, is there anything I'm missing:
<asp:Button ID="btnadd" runat="server" Text="add" OnClick="btnadd_Click" CausesValidation="False"/>
And this is the c# side:
protected void btnadd_Click(object sender, EventArgs e)
{
//do something
}
EDIT: solution, i had the button inside a form causing it not to work, removed the form and it worked