title: Accessing Class Properties in ASP.NET
body: <p>I have 2 C# classes: </p>
  
  <pre><code>public class Course
  {
      public string Title{get;set;}
      public int Code {get;set;}
  }
  
  public class Student 
  {
      public int Id{get;set;}
      public string Surname{get;set;}
      public Course Course {get;set}
  ...
  }
  </code></pre>
  
  <p>As you can see the Student class contains a reference to Course. I have a method in my application to return me a student object. In my ASP.NET .aspx file I have the following code:</p>
  
  <pre><code>...
  
  &lt;columns&gt;
  &lt;asp:BoundField DataField="Id" HeaderText="Id"/&gt;
  &lt;asp:BoundField DataField="Surname" HeaderText="Surname"/&gt;
  ...
  &lt;/columns&gt;
  
  ...
  </code></pre>
  
  <p>How do I access the values of the Course property in the Student class (i.e. how do I get the course code and title for the current student).</p>