我不确定如何更正此问题,但我在剃刀代码中出现错误 - >,箭头位于此处。任何帮助,将不胜感激。我知道我有两个' @'标志,但我无法访问' @ isDisabled'如果我不包含它,则在选项元素中。或者,我会在'旁边的@symbol说{'编译器抛出错误。
function() { return $(scrollElement).is(':visible') }
答案 0 :(得分:1)
试试这个
@foreach (LicenseUsage license in Model.AvailableLicenses)
{
bool hasBeenAssigned = Model.UserConsumedLicenses.Any(lic => lic.ClientLicenseId == license.ClientLicenseId);
bool isAvailable = license.LicensesAvailable == 0;
bool isDisabled = (hasBeenAssigned || isAvailable) ? false : true;
<option value="@license.ClientLicenseId" id="@license.LicenseId" @(isDisabled ? "disabled='disabled'" : "")>@license.LicenseName - (@license.LicensesConsumed/@license.LicenseQuantity) Consumed</option>
}