Check that the following is in your project files...
In the WebForm1.aspx on top.
Code:
<%@ Control Language="cs" AutoEventWireup="false" CodeBehind="WebForm1.aspx.cs" Inherits="[Namespace].WebForm1" %>
and in WebForm1.aspx.cs.
Code:
Namespace [Namespace]
    Partial Public Class WebForm1
Then dbl check that the Autogenerated WebForm1.aspx.designer.cs contains the following..
Code:
Namespace [Namespace]
    Partial Public Class WebForm1

        Protected WithEvents txtFirstName As Global.System.Web.UI.WebControls.TextBox