I have the following code in my view:
<%= Html.ActionLink(
\"View item\",
\"Index\",
\"Items\",
new
You should be able to just use the UrlHelper instance of your view to do this for you. Try giving this a shot:
<%= Html.ActionLink(
"View item",
"Index",
"Items",
new
{
itemName = Url.Encode(Model.ItemName)
},
null) %>
Update
After testing, it seems explicitly encoding like I did above seems to be less accurate and will cause the server to double-encode (eg - % will come out as %2525 in the url).