我正在尝试更改250000
的字体,但是当我在ActionLink
结束时,我无法更改它。
我尝试过:
, null
和
@Html.ActionLink(" Verification |", "VerIndex", "MFC_Form", new { deviceID = item.DeviceID, type = "Verification", id = "Color" }, null)
window.onload = function () {
var x = "fontColor";
alert("color " + x);
if (x == "fontColor") {
$("#Color").css('color', "red");
}
else {
$("#Color").css('color', "green");
}
}
和
@Html.ActionLink(" Verification |", "VerIndex", "MFC_Form", new { deviceID = item.DeviceID, type = "Verification", style = "color:red" }, null)
答案 0 :(得分:1)
您无法混合routeValues
和htmlAttributes
参数。这两个必须是不同的对象。
查看强>
@Html.ActionLink(" Verification |", "VerIndex", "MFC_Form", new {deviceID = item.DeviceID, type = "Verification"}, new { @class = "text-red" })
<强> CSS 强>
.text-red {
color: red;
}
生成的链接如下所示:
<a class="text-red" href="/MFC_Form/VerIndex?deviceID=1&type=Verification"> Verification |</a>