Error even with click method

1

Please can anyone help me with a annoying ASP.NET error? Next ... I have a button:

<asp:Button ID="cadastra" CssClass="btn btn-success btn-lg" runat="server" Text="Cadastrar Cliente" onclick="cadastra_Click1" />

And I have the method cadastra_Click1

protected void cadastra_Click1(object sender, EventArgs e)
{
   Response.Write("<script>alert('clockado');</script>");
}

When I try to run the code the compiler brings me the following error:

  

CS1061: 'ASP.ascx_address' does not contain a definition for 'cadastra_Click1' and no 'cadastra_Click1' extension method accepts that a first argument of type 'ASP.class_aspx' is found (you are not using a guideline or reference assembly?)

I do not know what else to do.

    
asked by anonymous 15.07.2015 / 21:02

1 answer

2

Try to delete the button and create it again with the project stopped. If you add a button with the project running sometimes it does not add in designer.cs , and another, make sure you have not renamed the copied and pasted page and renamed or something like that code may be pointed to an old source without the method .

At the top of aspx is a snippet that tells you where codebehind   CodeBehind="SuaPagina.aspx.cs" method must be in this file

    
15.07.2015 / 22:10