0
我嘗試使用AJAX加載文件,該文件無效。ASP.NET MVC AJAX加載文件
查看
@{
ViewBag.Title = "Index";
Layout = null;
}
<html>
<head>
<script src="@Url.Content("~/Scripts/jquery-1.4.4.min.js")" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function() {
$("button").click(function() {
$("div").load('test1.txt');
});
});
</script>
</head>
<body>
<div><h2>Let AJAX change this text</h2></div>
<button>Change Content</button>
</body>
</html>
到test1.txt的路徑是: 〜/查看/的Ajax/test1.txt的
到視圖的路徑是 〜/查看/的Ajax/Index.cshtml
有什麼想法?
謝謝您的建議。有用!! – Pingpong 2012-02-10 21:57:33