mvc使用笔记

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"}

 

posted on 2012-03-20 09:24  上校  阅读(296)  评论(0编辑  收藏  举报