Q:

why do i get a compilation error when i add a click event to a button in a page linked to a master page

I keep getting this error every time I add a button in my page: 

Server Error in '/' Application. 
  Compilation Error
  Description: An error occurred during the compilation of a resource required to service this request.  Please review the following specific error details and modify your source code appropriately.  

and

Compiler Error Message: CS1061: 'addproduct_aspx' does not contain a definition for 'btnadd_Click' and no extension method 'btnadd_Click' accepting a first argument of type 'addproduct_aspx' could be found (are you missing a using directive or an assembly reference?) 

Source Error:
Line 166:            <div class="row">
Line 167:                <div class="col-md-3">
Line 168:                    <asp:Button ID="btnadd" runat="server" Text="Save details" class="btn btn-default" OnClick="btnadd_Click" />
Line 169:                </div>
Line 170:                <div class="col-md-7"></div>

When i delete the OnClick="btnadd_Click" the the compilation error does not appear so i seems the error occurs each time i add the onclick line.  The page is linked to a masterpage as shown..
<%@ Page Title="" Language="C#" MasterPageFile="~/adminmaster. Master" AutoEventWireup="true" CodeBehind="addproduct.aspx.cs" Inherits="onlineshop.addproduct" %>

Even when I try and delete and add a new button I still get the compilation error please help? 

A:

Please create the method in CS file of this name btnadd_Click  With Parameters Manually
 
void btnadd_Click(object sender, EventArgs e)
    {
       //snip
    } 

