浏览器前进和后退无法在Javascript中正常工作

编程入门 行业动态 更新时间:2024-10-10 23:16:19
本文介绍了浏览器前进和后退无法在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中正常工作

本文发布于:2023-11-28 18:34:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1643504.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:浏览器   工作   Javascript

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!