在这里我使用了两个复选框
<label asp-for="SendReport" class="checkbox-inline"><input type="checkbox" asp-for="SendReport" />Send Report</label><br>
<label asp-for="SendInvoice" class="checkbox-inline"><input type="checkbox" asp-for="SendInvoice" />Send Invoice</label><br>
Run Code Online (Sandbox Code Playgroud)
和 checboc 的数据类型即asp-for="SendReport" and asp-for="SendInvoice"是bit.
现在的问题是,当我尝试加载页面时,它会抛出如下错误
Unexpected 'asp-for' expression result type 'System.Nullable`1[[System.Boolean, System.Private.CoreLib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]]' for <input>. 'asp-for' must be of type 'System.Boolean' or 'System.String' that can be parsed as a 'System.Boolean' if 'type' is 'checkbox'.<br>
Run Code Online (Sandbox Code Playgroud)
任何帮助将衷心感谢。谢谢
在这里,我试图在行中添加两个十进制值var totalSum = (grandTotal + getShippingCost).toFixed(3);并将值放入var getSumTd = $("tr#sumTr").find("span#sumSpan");.
但问题是var totalSum = (grandTotal + getShippingCost).toFixed(3);抛出一个错误说Uncaught TypeError: value.toFixed is not a function.
对我的代码的任何帮助都会有很大帮助。
下面是我的脚本
<script>
$('button#value-plus').on('click', function () {
debugger;
var divUpd = $(this).closest("tr").find('#qnty');
var subtotalcontainer = $(this).closest("tr").find('span#subtotal');
var mainGrandTotalcontainer = $("tr#mainGtTr").find("#mainGt");
var mainGtVal = parseFloat($("tr#mainGtTr").find('span#shippingCost').text());
var getSumTd = $("tr#sumTr").find("span#sumSpan");
var getShippingCost = parseFloat($("tr#mainGtTr").find('span#mainGt1').text());
var bklId = $(this).closest("tr").find('#pid').val();
var url = "/Product/incrementcart";
$.getJSON(url, { prdid: bklId }, function (data) {
debugger;
divUpd.val(data.qty);
var …Run Code Online (Sandbox Code Playgroud)