on html.actionlink click go to previous page

后端 未结 6 522
攒了一身酷
攒了一身酷 2021-01-31 16:17

Currently in a link

Customer/businessunit/RepresentativeDetails?RepresentativeId=cd3a7263-78f7-41bd-9eb0-12b30bc1059a

I have following code for vie

6条回答
  •  生来不讨喜
    2021-01-31 16:33

    Unless you're tracking what the previous page is on the server, why not just use the browser's internal history? In that case there wouldn't be a need for server-side code. You could just use something like this:

    Back to Details
    

    Or, separating the code from the markup:

    Back to Details
    
    
    

    This would send the user back to whatever was the last page in their browser history. (Of course, if they reached that page from any other source then it wouldn't take them "back to details" but instead just "back".)

提交回复
热议问题