title: fullname(firstname+" "+lastname) in dropdownlist in asp.net mvc
body: <p>I'm confuse to con-cat Firstname and Lastname and show list in Dropdownlist.
  I have this in my model</p>
  
  <pre><code> public string FullName
      {
          get
          {
              return Firstname+ " " + Lastname ;
          }
      }
  </code></pre>
  
  <p>In view I want FullName to show in dropdownlist or listbox
  I try below code in view but has error:</p>
  
  <pre><code> @Html.DropDownList("FullName", String.Empty)
                  @Html.ValidationMessageFor(model =&gt; model.tbl_hamyaran.FullName)
  </code></pre>
  
  <p>error:There is no ViewData item of type 'IEnumerable' that has the key 'FullName'.</p>
  
  <p><strong>I got my answer.</strong></p>
  
  <p><strong>I just need to change this line in my controller:</strong></p>
  
  <pre><code>     ViewBag.sabtkonande_ID = new SelectList(db.tbl_hamyaran, "ID", "Name");
  
  to line:
  
    ViewBag.sabtkonande_ID = new SelectList(db.tbl_hamyaran, "ID", "FullName");
  </code></pre>