<asp:LinkButton ID="lbView" runat="server" Text="View"
OnClientClick="window.open('DocumentViewer.aspx?ID=<%# Eval("ID") %>')">
</asp:LinkButton>
如果上述 din 工作,那么试试这个..
<asp:LinkButton ID="lbView" runat="server" Text="View"
PostBackUrl="window.open('DocumentViewer.aspx?ID=<%# Eval("ID") %>')">
</asp:LinkButton>
或者
<asp:LinkButton ID="lbView" runat="server" Text="View"
PostBackUrl="window.open("DocumentViewer.aspx?ID='<%# Eval("ID")%>'")">
</asp:LinkButton>
或者
为链接按钮提供 CommandName = "eject" .. 然后使用 GridView RowCommand 事件。
if(e.CommandName =="eject")
{
int index = convert.ToInt32(e.CommandArgument);
string id = GridView1.DataKeys[idx].Value.ToString();
Response.redirect("DocumentViewer.aspx?id='"+id+"'");
}