0

我想将 5 个参数传递给我的 js 函数。但是在传递这些参数时出现了一些错误。如何解决?

  <asp:Button ID="btnRezAktar" runat="server" Text="Aktar" OnClientClick='<%# Eval("o_no", "SubmitPage(\"{0}\", ") + Eval("k_ad", "\"{0}\") + Eval("gir_tar", "\"{0}\") + Eval("cik_tar", "\"{0}\") + Eval("gece_say", "\"{0}\")") %>' />

 <script language="javascript">
        function SubmitPage(o_no, k_ad, gir_tar, cik_tar, gece_say) {
            window.opener.document.getElementById('txtRoomNo').value = o_no.toString();
            window.opener.document.getElementById('txtNameSurname').value = k_ad.toString();
            window.opener.document.getElementById('txtStartDate').value = gir_tar.toShortDateString();
            window.opener.document.getElementById('txtFinishDate').value = cik_tar.toShortDateString();
            window.opener.document.getElementById('txtNightNum').value = gece_say.toString();
            this.close();
        }
    </script>
4

1 回答 1

2

试试这个

OnClientClick=
  '<%# string.Format("SubmitPage('{0}','{1}','{2}','{3}','{4}')", Eval("o_no"), Eval("k_ad"), Eval("gir_tar"), Eval("cik_tar"), Eval("gece_say")) %>'
于 2012-06-12T17:17:03.703 回答