小编Fin*_*ngs的帖子

什么是Object引用未设置为对象的实例

可能重复:
.NET中的NullReferenceException是什么?

什么是对象引用未设置为对象错误的实例意味着,如何停止获取此错误.

@Html.DropDownListFor(model=>model.Year,Model.Years)
Run Code Online (Sandbox Code Playgroud)

c# asp.net-mvc-3

1
推荐指数
1
解决办法
237
查看次数

如何根据td为tr添加css属性

我想根据表中的td单元格值将类应用于tr.

我的HTML

<table class="k-focusable">
 <tr>
  <th>Name</th>
  <th>Favorite color</th>
<th> status</th>
 </tr>
  <td>James</td>
  <td>red</td>
<td>false</td>
 </tr>
 <tr>
  <td>John</td>
  <td>blue</td>
  <td>true</td>
 </tr>
</table>

var cellIndexMapping = { 2: true };
$("table.k-focusable tbody tr").each(function (rowIndex) {
            $(this).find("td").each(function (cellIndex) {
                if (x[cellIndex]) {
                    var c = $(this).text();
                    if (($.trim(c) == "false") || ($.trim(c) == "null")) {
                        $("table.k-focusable tbody tr").find("td").addClass("hover");
                    }
                }
            });
        });

.hover
{
 font-weight:bold
}
Run Code Online (Sandbox Code Playgroud)

当我这样做时,每一行都有这个类悬停.但我希望只有在td值为false或null时才添加该类.

javascript jquery

1
推荐指数
1
解决办法
120
查看次数

区别"十进制"和"十进制"?类型,何时使用它们中的任何一个

谁能帮助我了解才知道之间的区别decimaldecimal?intint?

我何时应该使用它们以及使用它们中的任何一个是积极的.

c# nullable

0
推荐指数
2
解决办法
2258
查看次数

标签 统计

c# ×2

asp.net-mvc-3 ×1

javascript ×1

jquery ×1

nullable ×1