I am a web designer but I am told to design static pages in mvc where rather then using href="some url" I have to use href="@Url.Action("Controller", View)" Now I want to pass a section id in the url so when the user redirects it will be scrolled down to that specific section usually in html this is the syntax I use
href="index.html#mysectionid"
in Html I have something Like this
<section id="mysection">
</section>
I want to Know How I am gonna do this thing in mvc. Thanks
You can mix C# code with normal html in Razor:
<a href="@Url.Action("Contact", "Home")#mysection">Test</a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With