I have this code in the View:
<script src="../../Scripts/jquery.form.js" type="text/javascript"></script>
<script src="../../Scripts/jquery-1.5.1.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$('#myForm').ajaxSubmit();
});
@using (Html.BeginForm("PostData","Home",FormMethod.Post)) {
<input type="text" name="name" />
<input type="submit" value="submit" />
}
Then in the controller I have this method:
[HttpPost]
public void PostData(string name)
{
//do smoething with name
}
The problem is that I get redirected the url /home/PostData when submitting the form.
Anyone got any suggestions?