I have the following code in my view:
<%= Html.ActionLink(
"View item",
"Index",
"Items",
new
{
itemName = Model.ItemName
},
null) %>
I have a problem when the item name contains a sharp (#) or the percent symbol (%).
When the item name is "name#with#sharp#"
, the controller receives only the first part of the name until the first sharp (only receives "name"
).
When the item name is "name%with%percent"
I get an error: HTTP error 400 - Bad request.
I not sure if this is a problem with the URL encoding, because it works with other conflictive chars such as:
;
=
+
,
~
[blank]
Do you know how could I address this issue?
Thanks in advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…