In ASP.NET MVC, if I use:
<% Response.Write(Url.Action(“Index”,
“usermanagement”, new
RouteValueDictionary(new { page =
“{0}” }))); %>
I get:
/usermanagement?page=%7B0%7D
But I wanted to get:
/usermanagement?page={0}
Why is it encondig my parameter value, and what should I do to write the parameter value unencoded?
Thank you
The
Url.Actionhelper method is used to generate urls. Urls need to be URL encoded for them to be valid urls. So what you are observing is perfectly normal behavior. The helper generates a valid url by encoding all parameters.