<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>@ViewBag.Title</title> <link href="@Url.Content("~/Content/Site.css")" rel="stylesheet" type="text/css" /> <script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script> </head><body> <div class="page"> </div> <div id="Main"> <ul id="menu"> <li>@Ajax.ActionLink("登录系统", "Logon", "Account", null, new AjaxOptions() { UpdateTargetId = "main" }, new { @style = "" })|</li> </ul><div id="main"> </div> </div> </div></body></html>
AJAX is the art of exchanging data with the server and updating parts of a web page without reloading the entire page. However, in the above code, after clicking "Login System", the specified module "main" is not updated and loaded as expected, but a page is reloaded.
Solution: Add a reference in
:Regenerate the solution and the problem is solved.