1.Dictionary添加属性

@{
    Layout = "~/Views/Shared/_EditLayout.cshtml";
    Dictionary<string,object> dic=new Dictionary<string,object>();
    dic.Add("style", "background-color:#DCEEF0;height:280px;width:190px;");
    dic.Add("size", "4");

 

 @Html.ListBox("lbHas", new List<SelectListItem>() { }, dic);

 

 2. new { @class ="mycalss"}

 

相关文章:

  • 2022-02-15
  • 2021-08-05
  • 2022-12-23
  • 2021-07-31
  • 2021-12-31
猜你喜欢
  • 2021-07-26
  • 2021-06-09
  • 2021-11-21
  • 2022-12-23
  • 2022-12-23
  • 2022-01-27
  • 2021-12-25
相关资源
相似解决方案