I have a form
<script src="@Url.Content("~/Scripts/jquery-1.8.2.min.js")"></script>
<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>
@using (Html.BeginForm("Index", "Company",IsPost))
{
<div class="input-block-level">@Html.TextBoxFor(m => m.SearchString)
@Ajax.ActionLink("Submit", "Index", new{@class="btn"},new AjaxOptions {
HttpMethod = "Post",
UpdateTargetId = "partialDiv"
})
</div>
}
<div id="partialDiv"></div>
When the link that is created via Ajax.Actionlink
in browser is clicked, I don't get the value of the textbox in controllers post method. Why is that? Also, should I use Ajax.BeginForm
? I haven't use Ajax.BeginForm
yet, any tips on how could this Html.BeginForm
be transformed to Ajax.BeginForm
?