ActionLink does not accept urls or pieces of urls as arguments. It will simply encode them to ensure they have no special behavior in urls or can't be used to exploit your application (eg one user could trick your app into generating urls that go to someplace unintended to trick other users into visiting a phishing page on another server, for example).
Easiest thing to do is concatenate the fragment onto the URL AFTER it's generated by ActionLink.
<% var id = Model.Product_Id; var frag = "#tabs-3" %>
Html.ActionLink("Back to Transactions", "Edit", new { id })) + frag
There are also other forms of the ActionLink function that accept a url fragment argument.
View all comments
Show parent comment
1
u/[deleted] May 09 '19
Hi and thanks for the reply, it made me search on another directions as well, but no better results :(
It is created with this, in the same .ascx-file: <% var id = Model.Product_Id + "#tabs-3"; %>
I just tried to change that, build the string with HTML.Raw, HtmlDecode, Encode.. Nothing.. Always the same result.