I have registered a user control in my web config as below, then on my aspx page i place an instance of the control

Code:
<asp:Content ID="Content2" ContentPlaceHolderID="maincontent" Runat="Server">
    <AG:MenuControl ID="MenuControl1" runat="server" />
</asp:Content>
Code:
<configuration>
	<system.web>
   <compilation debug="true" targetFramework="4.0"/>
    <pages>
      <controls>
        <!-- Global Sourcing Platform user controls -->
        <add tagPrefix="AG" tagName="MenuControl" src="~/usercontrols/Menu.ascx" />
      </controls>
     </pages>
This works fine and the code builds and displays the control as desired.

The problem comes when I want to reference the control in code.

i.e.

Code:
ASP.usercontrols_Menu testvar;
It just does not appear in intellisense or allow build when trying to reference the usercontrols class. I get the error

Error 1 c:\Outlines\Outlines\usercontrols\Menu.ascx.cs(36): error CS0234: The type or namespace name 'outlines_usercontrols_menu_ascx' does not exist in the namespace 'ASP' (are you missing an assembly reference?)
Please could someone tell me what I am missing here.