我想在需要使用RowID作爲參數的超鏈接上調用我的js函數,我無法做到這一點!在超鏈接上使用參數調用Js函數
我嘗試了很多方法,但總是得到空值。
我該如何做到這一點?
<script>
var popUpObj;
function RowClick(filterId) {
popUpObj = window.open("voucher.aspx?param=" + filterId + "",
"ModalPopUp",
"toolbar=no," +
"scrollbars=no," +
"location=no," +
"statusbar=no," +
"menubar=no," +
"resizable=0," +
"width=530," +
"height=500," +
"left = 450," +
"top=130"
);
popUpObj.focus();
LoadModalDiv();
}
</script>
<MasterTableView ClientDataKeyNames="RowID" AllowPaging="True" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" CommandItemDisplay="Top" DataKeyNames="RowID" AllowCustomPaging="False" AutoGenerateColumns="False" AllowMultiColumnSorting="True" >
<Columns>
<telerik:GridBoundColumn DataField="RowID" DataType="System.Int32" FilterControlAltText="Filter RowID column" HeaderText="RowID" ReadOnly="True" SortExpression="RowID" UniqueName="RowID" Visible="False">
</telerik:GridBoundColumn>
<telerik:GridTemplateColumn FilterControlAltText="Filter RowID column" UniqueName="RowID" >
<ItemTemplate>
<asp:HyperLink runat="server" NavigateUrl="javascript:RowClick()" Text="Add voucher link"></asp:HyperLink>
</ItemTemplate>
</telerik:GridTemplateColumn>
你調用''javascript:RowClick()「'沒有參數,所以確定你有'filterId'參數_undefined_。你如何嘗試傳遞參數? – Grundy
是的javascript:RowClick(RowID)仍然是null – marios
你在哪裏得到'RowID'? – Grundy