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:表示母頁)

by mhchen15 on 4 12 月, 2012 in ASP.NET C#, Javascript, 程式 - Tags: ,
Tags: ,

There are no comments.

Name*: Website: E-Mail*:
XHTML: You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>