Passando parâmetros no MVC Ajax.ActionLink
Como posso enviar o valor da caixa de texto como parâmetro do ActionLin
Preciso usar o Html.TextBoxFor
<%= Html.TextBoxFor(m => m.SomeField)%>
<%= Ajax.ActionLink("Link Text", "MyAction", "MyController", new { foo = "I need here the content of the textBox, I mean the 'SomeField' value"}, new AjaxOptions{ UpdateTargetId = "updateTargetId"} )%>
O Contoller / Actions é assim:
public class MyController{
public ActionResult MyAction(string foo)
{
/* return your content */
}
}
Usando o MVC 2.0