ActionLink back button

前端 未结 3 2106
旧巷少年郎
旧巷少年郎 2020-12-21 18:42

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

3条回答
  •  北荒
    北荒 (楼主)
    2020-12-21 19:05

    I will go for a ActionLink like

    <%=Html.ActionLink("<< Back to News List", "Index")%>
    

    because user can access News/Details/1 directly and if then you have a link that uses history.go(-1) or history.back() function it will not redirect it to the Index action

提交回复
热议问题