12 月
04
04
Javascript 網頁轉址 方式
ASP.NET可註冊Script:
ScriptManager.RegisterStartupScript(this, this.GetType(), “btnSave_Click”, “window.location.href=’A.aspx?x=1′;”, true);
showModalDialog中使用Javascript轉址,在ASP.NET裡使用Page.Header.Controls.Add(new LiteralControl(@”<base target=””_self”” />”));也無效時,可用下列方式取代window.location.href:
window.name = “網頁名稱”;window.open(“A.aspx?x=1″,”網頁名稱”);
showModalDialog中若要讓母頁轉到某頁(或母頁重新整理),可用下列語法:
window.dialogArguments.location.href=’A.aspx’;
(dialogArguments:表示母頁)
There are no comments.