【发布时间】:2011-10-05 16:07:23
【问题描述】:
如何将 TextBox 的值作为 ActionLink 的参数发送?
我需要使用 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"} )%>
Contoller/Actions 如下所示:
public class MyController{
public ActionResult MyAction(string foo)
{
/* return your content */
}
}
使用 MVC 2.0
【问题讨论】:
标签: asp.net-mvc-2 parameters asp.net-ajax actionlink