Advertisement
Guest User

Untitled

a guest
Apr 25th, 2015
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. public class CameraDevice
  2. {
  3. public string IPAddress { get; set; }
  4. public string UDN { get; set; }
  5. public string DocumentURL { get; set; }
  6. public string FriendlyName { get; set; }
  7. public bool IsUSB { get; set; }
  8. public string Model { get; set; }
  9. public string Make { get; set; }
  10. public string DisplayName { get; set; }
  11. }
  12.  
  13. var devices = new List<CameraDevice>();
  14.  
  15. public ActionResult Connection()
  16. {
  17. var model = new ConnectionData();
  18. model.Devices = new SelectList(devices.Select(i => new { i.FriendlyName }), "Device");
  19. return View(model);
  20. }
  21.  
  22. public class ConnectionData
  23. {
  24. [Display(Name = "Device")]
  25. [Required(ErrorMessage = "Select")]
  26. public string SelectedDevice { get; set; }
  27. public IEnumerable<SelectListItem> devices { get; set; }
  28. }
  29.  
  30. @Html.DropDownListFor(m => m.SelectedDevice, Model.Devices, "Select Device", new { @style = "width: 355px;height:21px; border:none;outline:0px;" });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement