1.cshtml页面代码
@using MvcFoo.Controllers
@model Lanage
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Index</title>
<script src="~/Scripts/jquery-1.8.2.js"></script>
<script src="~/Scripts/jquery.unobtrusive-ajax.js"></script>
<script>
$(function () {
});
function success(data) {
alert('成功!'+data);
}
</script>
</head>
<body>
<div>
@using (Ajax.BeginForm("recive", new {controller="Home" }, new AjaxOptions
{
HttpMethod = "POST",
UpdateTargetId = "divsuccess",
OnSuc