日期:2014-05-16  浏览次数:20280 次

JavaScript 页面跳转后台的几种方法

 一:MsgBox.ShowAndRedirect(this, "保存成功!", "ReceiveAlert_Add.aspx");

该页面跳转子页面的时候自动刷新该页面的内容不会保存保存的页面内容


二:ScriptManager.RegisterClientScriptBlock(this.Page, typeof(Page), null, "alert('保存成功!');windows.location.href='ReceiveAlert_Add.aspx'", true);

该页面可以任意跳转页面,但是跳转到本页面的时候,该页面内容回自动保存到控件中

三:Response.Redirect("ReceiveAlert_Add.aspx");

可以跳转到任意页面,但是遇到alert('保存成功!');不会有任何反应。

 Response.Redirect("< script language=javascript>alert('保存成功!')< /script>");
 Response.Redirect("< script language=javascript>windows.location.href='ReceiveAlert_Add.aspx'< /script>");