Firstly apologies as this is about the millionth question I've asked recently but I'm being outwitted by MVC!
What I'm trying to do is this:
I've got a search box with a search icon next to it.
If a user types something in the search box and presses enter then httppost method is called on the controller (the value that the user has entered is passed to this method).
What I'd like to be able to do is replicate this exact behavior when the user types something and then clicks on the search image (without pressing enter).
This is what I've done so far (which obviously is completely wrong!)
@using (Html.BeginUmbracoForm<STEP_Umbraco.Controllers.CourseController>("Find")) { @Html.TextBox("zSearchTerm", TempData["SearchString"], new { id = "txtSearch", @class = "search", placeholder = "Search" }) @Html.ActionLink(".", "Find", "course", new { @class = "search-icon" }) }
What happens when I click the search image (@Html.ActionLink) I get the error of The resource cannot be found (Requested URL: /umbraco/Surface/Course/Find)
ActionLink as an Images
Hi all,
Firstly apologies as this is about the millionth question I've asked recently but I'm being outwitted by MVC!
What I'm trying to do is this:
I've got a search box with a search icon next to it.
If a user types something in the search box and presses enter then httppost method is called on the controller (the value that the user has entered is passed to this method).
What I'd like to be able to do is replicate this exact behavior when the user types something and then clicks on the search image (without pressing enter).
This is what I've done so far (which obviously is completely wrong!)
What happens when I click the search image (@Html.ActionLink) I get the error of The resource cannot be found (Requested URL: /umbraco/Surface/Course/Find)
Any help would be great :)
Thanks,
Craig
Replace your ActionLink with a good old fashioned HTML Image Button and it should just submit the form and work.
Turns out I'm overthinking everything!
Cheers matey
is working on a reply...