2015-01-15 32 views
0

以下是我的設計和代碼,我試圖重定向到上一頁按鈕單擊哪個不工作。重定向到上一頁按鈕單擊

<asp:ImageButton ID="btn_back" runat="server" ImageUrl="~/go_back.jpg" OnClientClick="Back()" Height="41px" Width="49px" /> 


<html xmlns="http://www.w3.org/1999/xhtml"> 
<head runat="server"> 
<title></title> 
<link rel='stylesheet' href='style_demo.css' type='text/css' media='all' /> 
<style type="text/css"> 
    .auto-style5 { 
     height: 33px; 
    } 
</style> 

<script type="text/javascript"> 
    function Back() { 
     debugger; 
     history.go(-2); 
     return false; 
    } 
</script> 

</head> 
<body> 
+2

沒有嘗試'window.history.back()'或'window.history.go(-1)' –

+0

我試過,但似乎沒有工作 – user2583182

回答

0

使用以下:

history.back(); 
+0

我已經設置JavaScript調試器,但JavaScript的不會調用clientclick上的Back(),因爲它不會將我帶入調試器 – user2583182

0

如果您想要的頁面永遠是你的,你從瀏覽最後一頁,你可以回去了。

window.history.back(); 
相關問題