2

The thing is that I have a card div in a View that when being clicked redirects you to another View; it is working fine and Im getting and URL like : localhost:34195/Home/Details/1 , but I need to add a # symbol on the Id parameter for me to get an URL like localhost:34195/Home/Details/#1 .

This is the div that calls the other View:

<div class="card z-depth-5" onclick="location.href='@Url.Action("Details", "Home",new { id = item.Id })'">
Abhijit Pritam Dutta
  • 5,521
  • 2
  • 11
  • 17
Marcelo
  • 784
  • 3
  • 9
  • 30

1 Answers1

4

After some help provided by an user that deleted his answer, I´ve accomplished what I needed by changing the onclick like this:

<div class="card z-depth-5" onclick="location.href='@Url.Action("Details", "Home")/#@item.Id'">
Marcelo
  • 784
  • 3
  • 9
  • 30