Hello all, I decided to open a new thread which I could use to ask questions about how to customize this new MVC application I created https://www.daniweb.com/web-development/aspnet/threads/497464/much-simpler-first-mvc-application, add HTML and change the default look and feel. If the mods are OK with that, I was thinking to use this thread as a general one and pop in any questions related to that when I get stuck, rather than create a new thread every time about the same app. I hope it is OK.
In fact here is the first question.
I'm trying to customize the Book Index view and add a link from there to the Review Index view, saying something like "Go to reviews". I had a good look online, my understanding is that rather than using hardcoded HTML, it is better to use HTML helpers, and so I did and created this
<div class="link">@Html.ActionLink("Go to Reviews", "Review")</div>
I read that this helpers can take several parameters, but I thought I'd do with two, the link text and the controller name. Unfortunately when I try that - remember that I'm in the Book view - the URL becomes localhost/xxxx/Book/Review rather than the localhost/xxxx/Review I was expecting, so it's appending the review controller at the end of the URL the link sits in. Had look online of course, some people say that the routing needs amending and remove the controller part, but isn't that a bit excessive? Then, in the list of possible parameters, I found the routevalue, 3rd parameter, so I changed the above to
<div class="link">@Html.ActionLink("Go to Reviews", "Review", "Home")</div>, but yet no joy, as the url now becomes localhost/xxxx/Home/Review, which, I would have thought was correct. Obviously not. NOt sure what else to try, any idea?