<ControlName_event> is not a member of 'ASP.default_aspx
<p>I am using the following ASP.NET 2.0 code in the Visual Web Developer 2010 Express and I get the following errors every time regarding my controls.</p>

<p>I want to know if I can use the specific ASP.NET 2.0 code in the ASP.NET 4.0 and also what I am doing wrong?</p>

<pre><code>    ERRORS:
    Error   1   'lblTime_Init' is not a member of 'ASP.default_aspx'.   

    Error   2   'chkUnderLine_CheckedChanged' is not a member of 'ASP.default_aspx'.        

    Error   3   'chkStrikeout_CheckedChanged' is not a member of 'ASP.default_aspx'.    

    Error   4   'chkOverLine_CheckedChanged' is not a member of 'ASP.default_aspx'.
</code></pre>

<p>DEFAULT.aspx</p>

<pre><code>&lt;%--&lt;@ Page Language="C#" AutoEventWireup="true" 

CodeFile="Default.aspx.cs" Inherits="_Default" %&gt;

&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml11.dtd"&gt;

&lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
&lt;head runat="server"&gt;
    &lt;title&gt;Checkbox Control&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
    &lt;form id="form1" runat="server"&gt;
    &lt;div style="height: 267px"&gt;

    &lt;h1&gt;Checkbox Control&lt;/h1&gt;
    &lt;asp:Label ID="lblTime" runat="server" 
    OnInit="lblTime_Init" 
            style="position: relative" /&gt;
    &lt;br /&gt;
    &lt;br /&gt;

        &lt;asp:CheckBox ID="chkUnderLine" runat="server"
            AutoPostBack="True"
            Text="Underline?"
            TextAlign="Left"
            oncheckedChanged="chkUnderLine_CheckedChanged" 
            style="position: relative"  /&gt;

        &lt;asp:CheckBox ID="chkStrikeout" runat="server" 
         AutoPostBack="True"
            Text="Strikeout?"
         oncheckedChanged="chkStrikeout_CheckedChanged" 
            style="top: 49px; left: 9px; position: relative; width: 82px; float: left"/&gt;

        &lt;asp:CheckBox ID="chkOverLine" runat="server" 
            AutoPostBack="True"
            Text="Overline?"
            oncheckedChanged="chkOverLine_CheckedChanged" 
            style="float: left; position: relative; top: 16px; left: -72px" /&gt;

    &lt;/div&gt;
    &lt;/form&gt;
&lt;/body&gt;
&lt;/html&gt;
  --%&gt;
</code></pre>

<p>'default.aspx.cs</p>

<pre><code>using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void lblTime_Init(object sender, EventArgs e)
    {
        lblTime.Font.Name = "Verdana";
        lblTime.Font.Size = 20;
        lblTime.Font.Bold = true;
        lblTime.Font.Italic = true;
        lblTime.Text = DateTime.Now.ToString();
    }

    protected void chkUnderLine_CheckedChanged(object sender, EventArgs e)
    {

        if (chkUnderLine.Checked)
            lblTime.Font.Underline = true;
        else
            lblTime.Font.Underline = False;
    }

    protected void chkOverLine_CheckedChanged(object sender, EventArgs e)
    {
        if (chkOverLine.Checked)
            lblTime.Font.OverLine = true;
        else
            lblTime.Font.Overline = false;
    }
    protected void chkStrikeout_CheckedChanged(object sender, EventArgs e)
    {
        if (chkStrikeout.Checkout)
            lblTime.Font.Strikeout = true;
        else
            lblTime.Font.Strikeout = false;
    }
}
</code></pre>
