title: MVC3, Razor, Html.DropDownListFor and Select lists
body: <p>I really hope someone can help me as I am getting COMPLETELY confused about what to do. Here's what I have right now</p>
  
  <p>Controller:</p>
  
  <pre><code>ViewBag.TrialTopic = _trialTopicTable.GetAll(u =&gt; u.PartitionKey == PartitionKey);
  return View(_dataTable.Get(u =&gt; u.PartitionKey == PartitionKey &amp; u.RowKey == RowKey););
  }
  </code></pre>
  
  <p>Model for the trial table</p>
  
  <pre><code>[DisplayName("Partition Key")]
  public override string PartitionKey { get; set; }
  [DisplayName("Row Key")]
  public override string RowKey { get; set; }
  ....
  public string TopicDescription { get; set; }
  ...
  </code></pre>
  
  <p>Model for the topic table</p>
  
  <pre><code>[DisplayName("Partition Key")]
  public override string PartitionKey { get; set; }
  [DisplayName("Row Key")]
  public override string RowKey { get; set; }
  public string TopicDescription { get; set; }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>@Html.DropDownListFor(model =&gt; model.Trial.TopicDescription, 
  new SelectList(ViewBag.TrialTopic, "TrialDescription", "TrialDescription"))
  </code></pre>
  
  <p>Some explanation. The data returned in the ViewBag.TrialTopic is seven trial topics, the column name with the data in that table is "Trial Description". In the main table called Trial I also have the "column name" "Trial Description". When the view shows I would like it to show the current value of trial description in the drop down. When I select a new value from the drop down I'd like that to be saved away when I save the form. </p>
  
  <p>I'm using Windows Azure table storage so I don't use any keys to store data in the main table. I store the full description. </p>
  
  <p>The problem is that with the above code there seems to be no connection between the value in the drop down and the form. I've looked at so many different examples and I'm now totally confused. Hope someone can give me some advice.</p>
  
  <p>thanks, </p>
  
  <p>Mandy</p>