网格视图中的弹出窗口(更新面板) [英] popup window in grid view (update pannel)
本文介绍了网格视图中的弹出窗口(更新面板)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在更新面板中有网格视图,
网格视图现在有一个链接按钮,我想打开一个新窗口
我尝试使用以下方法:
I have grid view in update panel,
grid view have a link button now i want to open a new window
I try this by using:
protected void GridView1_RowCommand(object sender, GridViewCommandEventArgs e)
{
string javaScript =
"<script language=JavaScript>\n" +
"window.open('Default2.aspx','_blank','resizable=no,height=275,width=550,left=500,top=350');\n" +
"</script>";
if (!ClientScript.IsStartupScriptRegistered("JSScript"))
{
ClientScript.RegisterStartupScript(this.GetType(), "JSScript", javaScript.ToString());
}
//Page.RegisterStartupScript("Page_Load", javaScript);
// ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "AddOnLife", javaScript, false);
//ScriptManager.RegisterClientScriptBlock(updpnlHold er,typeof(UpdatePanel), "AddOnLife", code, true);
}
但是它不起作用
BUt it doesn''t work
推荐答案
请使用下面的代码
Hi, use below code
ScriptManager.RegisterStartupScript(this, this.GetType(), "
%^&%^" ," ,
%^&%^", "window.open('MyPage.aspx','','width=400, height=400, left=300, top=400')", true);
这篇关于网格视图中的弹出窗口(更新面板)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文