How to pass #text with URL when redirecting from RedirectToAction
after post method
My URL: www.test.com/testController/testAction/15
I want this URL to be
www.test.com/testController/testAction/15#test
How to pass #text with URL when redirecting from RedirectToAction
after post method
My URL: www.test.com/testController/testAction/15
I want this URL to be
www.test.com/testController/testAction/15#test
You can use Redirect
for this in MVC
return Redirect("~/testController/testAction?id=15#test");
I hope this will work for you.
Use this RedirectResult
return new RedirectResult(Url.Action("testAction", "testController", new { id = 15 }) +"#Text");