【发布时间】:2011-06-03 07:32:52
【问题描述】:
我在 asp.net 中有一个使用 C# 的 Gridview 控件。
在我的应用程序中,当我按下 Gridview 中的编辑按钮时,我需要在另一个窗口中打开信息。此时我使用 'Response.Redirect("..")' 但它在同一个窗口中打开。
我试过了:
protected void OutputGridView_RowEditing(object sender, GridViewEditEventArgs e)
{
outputGridView.EditIndex = e.NewEditIndex;
GridViewRow row = outputGridView.Rows[outputGridView.EditIndex];
string url = "http://localhost/MyPage.aspx";
Response.Write("<script>");
Response.Write("window.open('" + url + "')");
Response.Write("<" + "/script>")
e.Cancel = true;
}
但没有运气。
最好的方法是什么?
【问题讨论】: