浏览器前进和后退无法在Javascript中正常工作 [英] Browser Back and forward not properly working in Javascript

查看:76
本文介绍了浏览器前进和后退无法在Javascript中正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

场景:
我在ASP.NET中有一个基于Web的应用程序.在其中,我实现了与浏览器相同的后退和前进功能.

问题:
一页后不起作用.表示它允许我后退/前进,但仅一页.我不想要那个.对于所有页面,它应该向后/向前.

代码:

Scenario:
I have a web based application in ASP.NET. in which i have implement Back and Forward functionality same like browser.

Problem:
It''s not working after one page. means it allows me to go back/foward but for only one page. i don''t want that. it should go backward/forward for all pages.

Code:

<asp:ImageButton ID="btnBack" runat="server" ImageUrl="Back_PNG.png"

                    OnClientClick="history.back()" />

<asp:ImageButton ID="btnForward" runat="server" ImageUrl="Forward_PNG.png"

                    OnClientClick="history.forward()" />



我应该怎么办 ?有帮助吗?

在此先感谢.



What should i do ? any help ?

Thanks in advance.

推荐答案

使用HTML按钮代替 asp:ImageButton ,它支持 history.back() history.forward()
use HTML button instead asp:ImageButton it supports history.back() and history.forward()


这篇关于浏览器前进和后退无法在Javascript中正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆