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.

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.

WBOY
Release: 2016-06-24 11:52:05
Original
1133 people have browsed it

<!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>
Copy after login

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.

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template