I can't figure out how to implement the list in the Search Input Page view
Here are the relevant models:
[Table("WordSearch")]
public class WordSearch
{
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
[MaxLength(80)]
[DisplayName("Exact Phrase")]
public string ExactPhrase { get; set; }
[MaxLength(80)]
[DisplayName("Required Words")]
public string RequiredWords { get; set; }
[MaxLength(80)]
[DisplayName("Alternate Words")]
public string AlternateWords { get; set; }
[NotMapped]
public int RangeId { get; set; }
[DisplayName("Range of Books")]
public ICollection<BibleBooks> Range { get; set; }
}//class WordSearch
[Table("BibleBooks")]
public class BibleBooks
{
[Key]
[Required]
public int ID { get; set; }
[MaxLength(20)]
public string Name { get; set; }
[DisplayName("OT-NT")]
public string Kind { get; set; }
public int Chapters { get; set; }
[MaxLength(4)]
public string Abbr { get; set; }
//maps to a 1-record dummy table
public int WordSearch_Id { get; set; }
}//class BibleBooks
(in the IdentityModels.cs file)
public class ApplicationDbContext : IdentityDbContext<ApplicationUser>
{
public DbSet<BibleStudy> BibleStudy { get; set; }
public DbSet<Book> Book { get; set; }
public DbSet<BibleBooks> BibleBooks { get; set; }
public DbSet<WordSearch> WordSearches { get; set; }
public ApplicationDbContext()
: base("DefaultConnection", throwIfV1Schema: false)
{
}
public static ApplicationDbContext Create()
{
return new ApplicationDbContext();
}
}
Here is the start of the view:
@model JQJ.Models.WordSearch
@{
ViewBag.Title = "Search Page";
}
<h2>Search Input Page</h2>
@using (Html.BeginForm())
{
@Html.AntiForgeryToken()
<div class="form-horizontal">
<h4>Word Search</h4>
...
Here is where I'm stuck:
<div class="form-group">
@Html.LabelFor(model => model.Range, htmlAttributes: new { @class = "control-label col-md-2" })
@Html.DropDownListFor(model => Model.Range,
@* or @Html.DropDownList( ?? *@
</div>
How do I finish that code for DropDownListFor or DropDownList ?
Thank you,