Home >Web Front-end >HTML Tutorial >When using Ajax.ActionLink, clicking the corresponding button will reload a page instead of loading _html/css_WEB-ITnose in the specified module of the current page.
<!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 93f0f5c25f18dab9d176bd4f6de5d30e9c3bca370b5104690d9ef395f2c5f8d1:
8a0b2702947fa9cc067181a8bf4d60ce2cacc6d41bbb37262a98f745aa00fbf0
Regenerate the solution and the problem is solved.