ActionLink的后退按钮 [英] ActionLink back button

查看:237
本文介绍了ActionLink的后退按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个具有双重用途为显示职位列表和职位的查询列表,也可以有网页,所以你得到像 /新闻/页/ 1 /新闻?查询=测试

I have an Index method that does double duty as showing a list of posts and a queried list of posts and can also have pages so you get urls like /News/Page/1 or /News?query=test

当用户点击通过在说一个岗位新闻/详细信息/ 1 他们得到了一个简单的ActionLink这需要他们回到列表。但我想这个链接带他们回到他们在分页或查询的词条实际页面。我怎么能这样做呢?我不想使用JavaScript历史的方法。这是我目前的ActionLink的:<%= Html.ActionLink(<<返回新闻列表,指数)%> ,这是一个例子分页链接:<%= Html.RouteLink(<<第一页,NewsPaging,新的{查询=计算机[查询],页= 0})%&GT ;

When a user clicks through to a post at say News/Details/1 they get a simple ActionLink that takes them back to the list. BUT I want this link to take them back to the actual page they were on in terms of the paging or the query. How could I do this? I don't want to use the JavaScript history method. Here is my current ActionLink: <%=Html.ActionLink("<< Back to News List", "Index")%> and this is an example of the paging links: <%= Html.RouteLink("<< First Page", "NewsPaging", new { query = ViewData["query"], page = 0 })%>

感谢

推荐答案

它可能会更容易只使用JavaScript来送他们返回到上一个页面的历史记录(不创建一个链接到特定的页面)。

It would probably be easier to just use javascript to send them back to the last page in their history (without creating a link to the specific page).

history.go(-1)

这篇关于ActionLink的后退按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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