0

我想在我的列表视图中将参数传递给我的 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>

那有什么问题?

4

1 回答 1

0
OnClientClick='<%# Eval("o_no", "SubmitPage(\"{0}\", ") + Eval("k_ad", "\"{0}\")") %>'
于 2012-06-04T14:26:55.730 回答