title: Get value of droplink in Code-Behind
body: <p>I am trying to get the display name of an item in a droplink in the back-end C# code.  I am using Sitecore 6.6, not using MVC, and am setting a droplink control in the CMS for clients called <code>Address</code>. The droplink source goes to <code>/sitecore/Templates/User Defined/WAC/Address</code>, and the individual items have an SEO-compliant name and a readable display name. </p>
  
  <p>For example: </p>
  
  <ul>
  <li>Item ID: {9E60F5F8-FBF2-4CBD-BB13-6A93397AAC87} </li>
  <li>Name: 100-main-street</li>
  <li>Display Name: 100 Main Street, Sample Town, 10011</li>
  </ul>
  
  <p>My code:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      String sl = "";
      Sitecore.Data.Items.Item currentItem = Sitecore.Context.Item;
      // BEGIN main class list
      Sitecore.Collections.ChildList classList = currentItem.Children;
      foreach (Sitecore.Data.Items.Item mainPage in classList)
      {
          if (mainPage.TemplateID.ToString() == "{27A9692F-AE94-4507-8714-5BBBE1DB88FC}")
          {
              sl += "&lt;span class=\"address\"&gt;" + mainPage.Fields["Address"] +"&lt;/span&gt;";
          }                            
          else
          {
          }
      }
      // END main class list
      classSessionList.Text = sl;
  }
  </code></pre>
  
  <p>This code will give me the ID of the Item. If I use <code>mainPage.Fields["Address"].DisplayName</code>, I get "Address". </p>
  
  <p>How can I get the Display Name of the item from the droplink?</p>