如何使用docker在带有SQL后端的C#ASP.NET MVC Web应用程序中创建下拉列表

问题描述

这是课程:

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>

我只是不明白如何以下拉列表形式返回authorList

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)