KingOfKong
KingOfKong

Reputation: 279

Creating querystring with anchor link

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

Upvotes: 1

Views: 199

Answers (1)

Orion_Dev
Orion_Dev

Reputation: 49

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.

Upvotes: 1

Related Questions