我想在我的列表视图中将参数传递给我的 js 函数。我用一个参数做到了这一点。像那样 :
<asp:Button ID="btnRezAktar" runat="server" Text="Aktar" OnClientClick='<%# "SubmitPage(" + Eval("o_no") +" );"%>' />
<script language="javascript">
function SubmitPage(o_no) {
window.opener.document.getElementById('txtRoomNo').value = o_no.toString();
this.close();
}
</script>
但我想传递两个参数,它不起作用:
<asp:Button ID="btnRezAktar" runat="server" Text="Aktar" OnClientClick='<%# "SubmitPage(" + Eval("o_no") + "," + Eval("k_ad") + " );"%>' />
<script language="javascript">
function SubmitPage(o_no, k_ad) {
window.opener.document.getElementById('txtRoomNo').value = o_no.toString();
window.opener.document.getElementById('txtNameSurname').value = k_ad.toString();
this.close();
}
</script>
那有什么问题?