Skip to content

Instantly share code, notes, and snippets.



Created Mar 17, 2017
What would you like to do?
protected void Button1_Click(object sender, EventArgs e)
// 何かしらの処理
StringBuilder script = new StringBuilder();
// 重要なのは↓
script.Append("<script language='JavaScript'> if (WebForm_RestoreScrollPosition) WebForm_RestoreScrollPosition();");
script.Append("window.showModalDialog('hoge.aspx', window, 'dialogWidth: 300px; dialogHeight: 200px; center; scroll=0; status=0,location=0');</script>");
ClientScriptManager csMgr = Page.ClientScript;
csMgr.RegisterStartupScript(this.GetType(), "DoOpenScript", script.ToString(), false);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.