Hi,
How to add #dept in my URL from Controller
on submit button click bellow controller "passmyval" is called
Want URL like sholud be : home/Stug#dept
[HttpPost] public ActionResult passmyval() { return RedirectToAction("Stug"); }
Hi Rockstar8,
Checkk with the below code.
[HttpPost] public ActionResult passmyval() { return Redirect(Url.Action("Stug", "Home") + "#dept"); }
Or
Refer below links.
https://stackoverflow.com/questions/26718722/how-to-use-redirecttoaction-to-redirecto-to-a-position-in-the-page
https://stackoverflow.com/questions/10690466/redirect-to-a-hash-from-the-controller-using-redirecttoaction/21421699
© COPYRIGHT 2025 ASPSnippets.com ALL RIGHTS RESERVED.