如何解决如何使用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 举报,一经查实,本站将立刻删除。