前后台页面跳转方式搜集
前臺(tái)頁面跳轉(zhuǎn):
?? ? ?1、帶frame的跳轉(zhuǎn)?
?? ? ? ? a ? window.frames.frameName.location.href= url; //frameName代表某個(gè)frame,url代表跳轉(zhuǎn)的路徑。?
?? ? ? ? b ? 打開一個(gè)新窗口,window.open(url,'frameName');?
?? ? 2、不帶frame的跳轉(zhuǎn)?
?? ? ? ?a ? ?window.location.href=url;?
?? ? ? ?b ? ?window.history.back(-1);//后退?
?? ? ? ?c ? ?window.history.go(-1||-2||...);//后退到前一||二||。。。頁面?
?? ? ? ?d ? ?window.navigate(url);?
?? ? ? ?e ? ?self.location = url;?
?? ? ? ?f ? ?top.location = url;?
?? ? ? ?g ? ?window.location.reload();//刷新當(dāng)前頁面?
?? ? ? ?h ? ?parent.location.reload();//刷新父親對(duì)象頁面?
?? ? ? ?i ? ?opener.location.reload();//刷新父窗口頁面?
后臺(tái)頁面跳轉(zhuǎn):
?? ? 1、<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="target.aspx">目標(biāo)</asp:HyperLink>
?? ? 2、Response.Redirect("WebForm2.aspx")
?? ? ? ? ?或者
? Response.Redirect("http://www.zhisi.net/")
?? ? 3、Server.Transfer("WebForm2.aspx",True),或者:Server.Transfer("WebForm2.aspx")
注:切換對(duì)象
?? ? ? 1、Response.Redirect可以切換到任何存在的網(wǎng)頁。
2、Server.Transfer只能切換到同目錄或者子目錄的網(wǎng)頁。
數(shù)據(jù)保密
1、Response.Redirect后地址會(huì)變成跳轉(zhuǎn)后的頁面地址。
2、Server.Transfer后地址不變,隱藏了新網(wǎng)頁的地址及附帶在地址后邊的參數(shù)值。具有數(shù)據(jù)保密功能。
傳遞的數(shù)據(jù)量(網(wǎng)址后附帶的參數(shù))
1、Response.Redirect能夠傳遞的數(shù)據(jù)以2KB為限。
2、傳遞的數(shù)據(jù)超過2KB時(shí),務(wù)必使用Server.Transfer。
轉(zhuǎn)載于:https://www.cnblogs.com/QiuJL/archive/2011/07/27/4524359.html
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)總結(jié)
以上是生活随笔為你收集整理的前后台页面跳转方式搜集的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: poj 3080 Blue Jeans
- 下一篇: POJ2262Goldbach's Co