方案一:簡單
的方法,新窗口不固定大小
<ASP:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" CellPadding="3" OnRowDeleting="GridView1_RowDeleting" OnRowEditing="GridVIEw1_RowEditing"
OnRowUpdating="GridView1_RowUpdating" OnRowCancelingEdit="GridVIEw1_RowCancelingEdit" BackColor="White" BorderColor="#CCCCCC" Border BorderWidth="1px" Font-Size="12px" >
<FooterStyle BackColor="White" ForeColor="#000066" />
<Columns>
<ASP:BoundField DataFIEld="SFZ號碼" HeaderText="編號" ReadOnly="True" />
<ASP:BoundField DataFIEld="郵政編碼" HeaderText="郵政編碼" SortExpression="郵政編碼" />
<ASP:BoundField DataFIEld="家庭住址" HeaderText="家庭住址" />
<asp:HyperLinkField HeaderText="姓名" Text="姓名" DataNavigateUrlFIElds="姓名" DataNavigateUrlFormatString="Default6.aspx?GoodsID={0}" Target="mainframe" NavigateUrl="~/Default6.ASPx" DataTextFIEld="姓名" >
</ASP:HyperLinkFIEld>
<ASP:CommandFIEld HeaderText="選擇" ShowSelectButton="True" />
<ASP:CommandFIEld HeaderText="編輯" ShowEditButton="True" />
<ASP:CommandFIEld HeaderText="刪除" ShowDeleteButton="True" />
</Columns>
<RowStyle ForeColor="#000066" />
<SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
<HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
</ASP:GridVIEw>
DataNavigateUrlFIElds是鏈接的字段名,DataNavigateUrlFormatString是路徑。
方案二:精確控制彈出窗口大小位置
<ASP:HyperLinkColumn DataNavigateUrlFIEld="EmployeeID" DataNavigateUrlFormatString="Javascript:varwin=window.open('detail.ASPx?ID={0}',null,'width=300,height=200');window.Close();"
DataTextFIEld="LastName" HeaderText="LastName"></ASP:HyperLinkColumn>