在我的表单中,当我单击网格视图中的编辑按钮时,我需要打开一个新窗口。还必须将相应的 ID 值传递给新窗口。我编写了在新窗口中打开的代码,但它不是工作。我搜索并找不到如何将所选记录的 ID 值发送到新窗口。请帮助我如何执行此操作。
<asp:GridView ID="gridUserDetails" runat="server" BackColor="White"
BorderColor="#336666" BorderStyle="Double" BorderWidth="3px" CellPadding="4"
GridLines="Horizontal" AutoGenerateColumns="False" AllowSorting="true"
onselectedindexchanged="gridUserDetails_SelectedIndexChanged" onsorting="SortingGridData">
<Columns>
<asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" />
<asp:BoundField DataField="Name" HeaderText="Employee Name" SortExpression="Name" />
<asp:BoundField DataField="Address" HeaderText="Employee Address" SortExpression="Address" />
<asp:BoundField DataField="Email" HeaderText="Employee Mail" SortExpression="Email"/>
<asp:BoundField DataField="Department" HeaderText="Department" SortExpression="Department"/>
<asp:TemplateField>
<ItemTemplate>
<asp:Button ID="btnEdit" CausesValidation="false" runat="server" Text="Edit"
onClientClick="windowopen()"/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="White" ForeColor="#333333" />
<HeaderStyle BackColor="#336666" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#336666" ForeColor="White" HorizontalAlign="Center" />
<RowStyle BackColor="White" ForeColor="#333333" />
<SelectedRowStyle BackColor="#339966" Font-Bold="True" ForeColor="White" />
<SortedAscendingCellStyle BackColor="#F7F7F7" />
<SortedAscendingHeaderStyle BackColor="#487575" />
<SortedDescendingCellStyle BackColor="#E5E5E5" />
<SortedDescendingHeaderStyle BackColor="#275353" />
</asp:GridView>
这是我的 Grid 的代码。下面是我的 javascript
<script language="javascript" type="text/javascript">
function windowopen() {
mywindow = window.open('ISSRegistrationForm.aspx', 'Employee Details', 'height=500, width=1100, status=no, resizable=no, scrollbars=yes, toolbar=no,location=no, menubar=no'
}
</script>