1

I have a controller that returns a redirect and I want to add an anchor link so it goes to a specific element. The problem I'm having is the element '#' gets converted to '%23'. I've tried encoding and decoding both # and %23 but it doesn't seem to work, so I feel like I'm missing something.

The code is:

return RedirectToCurrentUmbracoPage($"?success={success.ToString().ToLower()}"+"#sentletter");

I want the result to be

?success=true#sentletter

but it ends up as

?success=true%23sentletter

Thanks

KingOfKong
  • 279
  • 7
  • 17

1 Answers1

1

In server side you have various methods for URL encoding, this info is very useful for a encoding in server side, for cliente side you can check this info for more info.

Community
  • 1
  • 1
Orion_Dev
  • 29
  • 4