*.aspx ページから文字列を変換しようとしています:
ジェイブスクリプト:
function updateOnClick() {
if (!toIgnore) {
refNo = document.getElementById("txtRef").value;
note1000 = removeCommas(document.getElementById("txtNote_1000").value.substring(1));
note100 = removeCommas(document.getElementById("txtNote_100").value.substring(1));
note50 = removeCommas(document.getElementById("txtNote_50").value.substring(1));
note20 = removeCommas(document.getElementById("txtNote_20").value.substring(1));
note10 = removeCommas(document.getElementById("txtNote_10").value.substring(1));
note5 = removeCommas(document.getElementById("txtNote_5").value.substring(1));
note2 = removeCommas(document.getElementById("txtNote_2").value.substring(1));
note1 = removeCommas(document.getElementById("txtNote_1").value.substring(1));
coins = removeCommas(document.getElementById("txtCoins").value.substring(1));
cheque = removeCommas(document.getElementById("txtCheque").value.substring(1));
outstanding = removeCommas(document.getElementById("txtOutstanding").value.substring(1));
total = removeCommas(document.getElementById("txtTotal").value.substring(1));
collectable = removeCommas(document.getElementById("txtCollectable").value.substring(1));
difference = removeCommas(document.getElementById("txtDifference").value.substring(1));
collectionDate = document.getElementById(prefix + "txtDate").value;
iniXmlHttp();
xmlhttp.onreadystatechange = function () {
if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
responseText = xmlhttp.responseText;
if (responseText == "") {
loadDailyCollectionTable();
document.getElementById("txtRef").focus();
document.getElementById("txtRef").select();
}
}
}
xmlhttp.open("GET", "DailyCollectionPage.aspx?funcName=updateDailyCollection&RefNo=" + refNo +
"&collectionDate=" + collectionDate + "¬e1000=" + note1000 + "¬e100=" + note100 +
"¬e50=" + note50 + "¬e20=" + note20 + "¬e10=" + note10 + "¬e5=" + note5 +
"¬e2=" + note2 + "¬e1=" + note1 + "&coins=" + coins + "&cheque=" + cheque +
"&outstanding=" + outstanding + "&total=" + total + "&collectable=" + collectable +
"&difference=" + difference, true);
xmlhttp.send();
}
else
toIgnore = false;
}
コード ビハインドでは、文字列を 10 進数に変換しようとすると、次の行でエラーが発生します。
dailyCollection.Notes_1000 = Convert.ToDecimal(Request["note1000"]);
エラーは次のとおりです。INPUT STRING WAS NOT IN A CORRECT FORMAT.
誰かが私のコードで何が間違っているか教えてもらえますか? どんな助けでも大歓迎です!