Link
Link

Reputation: 57

Why is '+' Character Removed From Url

Why does Mvc remove + from code=wamTEpI6kZcP997j2d+ZeQ==

link

http://localhost:33693/PasswordRecovery/[email protected]&code=wamTEpI6kZcP997j2d+ZeQ==

Controller Func

public ActionResult InitPassword(string email, string code)
{
    return View();
}

Upvotes: 2

Views: 681

Answers (1)

HaukurHaf
HaukurHaf

Reputation: 13796

Th '+' sign has a special meaning in URLs, it means 'space'.

You should UrlEncode the code parameter to preserve the '+' sign.

You can use @Uri.EscapeDataString() or @Html.Raw() in your Razor views.

Upvotes: 6

Related Questions