I am using the code below to send the user to an anchor on submit of a form, but its not working. The page does refresh fine, but it doesn’t continue to the anchor #contact
using (Html.BeginForm("Index", "Home", new { ReturnUrl = "#contact" }, FormMethod.Post, new { novalidate = "novalidate" }))
When the page refreshes I end up with a url looking like this, which in honesty doesnt look right to me either
http://localhost:52438/?ReturnUrl=%23contact
or thought this maybe
using (Html.BeginForm("Index", "Home", FormMethod.Post, new { novalidate = "novalidate" } + "#contact"))
So i tried this and yes it hides the return URL bit, but it doesnt go to the anchor, I’m probably miles off in honesty
using (Html.BeginForm("Index", "Home", FormMethod.Post, new { novalidate = "novalidate" }))
{
@Html.Hidden("returnUrl", "#contact")