I'm completely stumped.
I'm doing a searchform in MVC2 (I've done dozen others on this project, all working fine.)
Global.asax has this route:
routes.MapRoute("OnlineHelpSearchIndex",
"Help/Search/{expression}/{page}",
new { controller = "OnlineHelp", action = "Search", expression = UrlParameter.Optional, page=1 });
The expression is a base64 encoded string. I decode it in controller, pass it to a model which has a property named Expression
, and display it in a PartialView in a TextBox. (Then when the user clicks a link or presses enter, I encode the string in javascript and send it to "/Help/Search/"+value
)
I have several searchboxes built this way (each with a route SomeModule/Search/{expression}
), and one of them is not working.
<%:Html.DisplayFor(m => m.Expression)%>
<%: Model.Expression %>
<%:Html.TextAreaFor(m => m.Expression)%>
<%:Html.TextBoxFor(m => m.Expression)%>
<%:Html.EditorFor(m => m.Expression)%>
The first two display the correct expression, the other three displays the expression in the url.
I tried hardcoding a string into the model, the first two displayed the hardcoded string, the other three displayed whatever was in the url. How is it possible?
(I even tried with JS disabled, so it is a server side issue)