0

This is the class:

public class Book
{
    public int id { get; set; }
    public string BookName { get; set; }
    public int AuthorId { get; set; }
    public string AuthorFirstName { get; set; }
    public string AuthorLastName { get; set; }
    public List<Author> Authors_List { get; set; }
}

CSHTML:

    <div class="form-group">
        @Html.LabelFor(model => model.AuthorId, htmlAttributes: new { @class = "control-label col-md-2" })
        <div class="col-md-10">
            @Html.EditorFor(model => model.AuthorId, new { htmlAttributes = new { @class = "form-control" } })
            @*@Html.DropDownList("AuthorId", null, htmlAttributes: new { @class = "form-contol"})*@
            @Html.ValidationMessageFor(model => model.AuthorId, "", new { @class = "text-danger" })
        </div>
    </div>

I just don't understand how to return the authorList as a dropdown

3

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.