ASP.NET and C# compilation error while attempting to instantiate a new object from a class
I have this simple ASP.NET page here:

    <%@ Page Language="C#" src="Tree.cs" %>    
    <html>    
    <head>    
    <title>Planting Trees</title>    
    <script runat="server">    
     protected void Page_Load(Object Source, EventArgs E)    
    {    
    string msg = "Let's plant some trees!<br/>";    
        
    // Create a new Tree    
    Tree tree1 = new Tree();    
      
    msg += "I've created a tree with a height of " +    
    tree1.height + " metre(s).<br/>";    
      
    tree1.Grow(3);    
     
    msg += "After a bit of growth, it's now up to " +    
    tree1.height + " metre(s) tall.<br/>";    
       
    msg += "Maybe eventually it will grow to 10 meters tall!</br>…<br/>";
    
    tree1.Grow(7);
    
    msg += "*15 years later*<br/>Let's check out our tree's height now!  It's now up to " + tree1.height + " meter(s) tall!  Awesome!<br/>";
        
    Output.Text = msg;   
    
    string msg2 = "Let's plant some coconut trees!<br/>";
    
    // Create a new Tree
    CoconutTree coconutTree1 = new CoconutTree();
    
    msg2 += "I've created a tree with " + coconutTree1.numNuts + " coconuts.<br/>";
    
    coconutTree1.GrowNut(10);
    
    ms2 += "I've now grown " + coconutTree1.numNuts + " coconuts on our tree.<br/>";
    
    Output2.Text = msg2;
     
       }
    </script> 
    
    </script>    
    </head>    
    <body>    
    <p><asp:label runat="server" id="Output" /></p>
    <p><asp:label runat="server" id="Output2" /></p> 
    </body>    
    </html>

With this simple class:

    // Tree.cs, A simple C# class
    
    public class Tree {
    
      public int height = 0;
      
      public void Grow(int numberToGrow) {
        height += numberToGrow;
      }
    
    }
    
    public class CoconutTree : Tree {
    
      public int numNuts = 0; //Number of coconuts
      
      public void GrowNut(int numberToGrow) {
        numNuts += numberToGrow;
      }
    
      public void PickNut(int numberToPick) {
        numNuts -= numberToPick;
      }
    }

Now, I bet the compilation error lies with the fact that I'm declaring two classes in the same .cs file, but I'm not 100% sure.

Chrome highlights the line:

`CoconutTree coconutTree1 = new CoconutTree();`

As the problem..

**UPDATE (WITH ERROR! xD):**

Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error.

Compiler Error Message: CS0246: The type or namespace name `CoconutTree' could not be found. Are you missing a using directive or an assembly reference?

ASP.NET and C# compilation error while attempting to instantiate a new object from a class
===

I have this simple ASP.NET page here:

    <%@ Page Language="C#" src="Tree.cs" %>    
    <html>    
    <head>    
    <title>Planting Trees</title>    
    <script runat="server">    
     protected void Page_Load(Object Source, EventArgs E)    
    {    
    string msg = "Let's plant some trees!<br/>";    
        
    // Create a new Tree    
    Tree tree1 = new Tree();    
      
    msg += "I've created a tree with a height of " +    
    tree1.height + " metre(s).<br/>";    
      
    tree1.Grow(3);    
     
    msg += "After a bit of growth, it's now up to " +    
    tree1.height + " metre(s) tall.<br/>";    
       
    msg += "Maybe eventually it will grow to 10 meters tall!</br>…<br/>";
    
    tree1.Grow(7);
    
    msg += "*15 years later*<br/>Let's check out our tree's height now!  It's now up to " + tree1.height + " meter(s) tall!  Awesome!<br/>";
        
    Output.Text = msg;   
    
    string msg2 = "Let's plant some coconut trees!<br/>";
    
    // Create a new Tree
    CoconutTree coconutTree1 = new CoconutTree();
    
    msg2 += "I've created a tree with " + coconutTree1.numNuts + " coconuts.<br/>";
    
    coconutTree1.GrowNut(10);
    
    ms2 += "I've now grown " + coconutTree1.numNuts + " coconuts on our tree.<br/>";
    
    Output2.Text = msg2;
     
       }
    </script> 
    
    </script>    
    </head>    
    <body>    
    <p><asp:label runat="server" id="Output" /></p>
    <p><asp:label runat="server" id="Output2" /></p> 
    </body>    
    </html>

With this simple class:

    // Tree.cs, A simple C# class
    
    public class Tree {
    
      public int height = 0;
      
      public void Grow(int numberToGrow) {
        height += numberToGrow;
      }
    
    }
    
    public class CoconutTree : Tree {
    
      public int numNuts = 0; //Number of coconuts
      
      public void GrowNut(int numberToGrow) {
        numNuts += numberToGrow;
      }
    
      public void PickNut(int numberToPick) {
        numNuts -= numberToPick;
      }
    }

Now, I bet the compilation error lies with the fact that I'm declaring two classes in the same .cs file, but I'm not 100% sure.

Chrome highlights the line:

`CoconutTree coconutTree1 = new CoconutTree();`

As the problem..

**UPDATE (WITH ERROR! xD):**

Description: Error compiling a resource required to service this request. Review your source file and modify it to fix this error.

Compiler Error Message: CS0246: The type or namespace name `CoconutTree' could not be found. Are you missing a using directive or an assembly reference?
