I am doing a classic search field with a button. I am using Ajax.ActionLink for the button, and I cannot figure out how to get the textbox value posted in the ActionLink. I looks like this:
<div class="input-append">
<input type="text" id="Company_CompanyName" />
@Ajax.ActionLink("search",
"CompanySearch",
new { searchString = "???" },
new AjaxOptions
{
HttpMethod = "GET",
InsertionMode = InsertionMode.Replace,
UpdateTargetId = "CompanySearchResults"
},
htmlAttributes: new { @class = "btn" })
</div>
<div id="CompanySearchResults"></div>
Where the ??? is, is where I don't know how to get the value from the textbox in. What do I do?
UPDATE 1: It is a nested form
As I should have mentioned in the original post/question, this is a nested form, i.e. there is an outer form to be submitted. Therefore if I make a Ajax.BeginForm() with a submit inside it, it will invoke the submission of the outer form. I obviously want to avoid that.