Hi,
How to re-write Url.ActionParametrized("actionname", New With {.ID= "{1}"}) in C#
because when i wrote this
Url.Action("actionname", new { ID= "{1}" });
in the execution i see that :
"Path?ID=%7B1%7D"
Thank you.
UrlHelper, generates a url, not a route path. The anonymous object will generate the query string, you need to pass the actual value you want query parameter to be.
Hi, windows2056
You can write like this:
@Url.Action("About", "Home", new { ID = 1}) @Url.Action("About", "Home", new { test = "1" })
More details, you could refer to this link:http://techfunda.com/howto/251/get-url-of-action-method.
Here is the result.
Best Regards,
YihuiSun