我有一个自定义的JavaScript验证函数,它位于.Net 2.0网站,判断支付的费用是否超过 payable 费用.
我已经将验证程序代码放在了ascx
文件中,我还try 了使用Page.ClientScript.RegisterClientScriptBlock()
,在这两种情况下都会触发验证,但找不到JavaScript函数.
The output in Firefox's error console is "feeAmountCheck is not defined"
. Here is the function (this was taken directly from firefox->view source)
<script type="text/javascript">
function feeAmountCheck(source, arguments)
{
var amountDue = document.getElementById('ctl00_footerContentHolder_Fees1_FeeDue');
var amountPaid = document.getElementById('ctl00_footerContentHolder_Fees1_FeePaid');
if (amountDue.value > 0 && amountDue >= amountPaid)
{
arguments.IsValid = true;
}
else
{
arguments.IsValid = false;
}
return arguments;
}
</script>
你知道为什么找不到这个函数吗?我如何才能在不将函数添加到母版页或使用页的情况下解决此问题?