开发者

Walkthrough: Adding ASP.NET AJAX Scripting to an MVC Project

I'm trying to learn more about asp.net ajax. But when I followed (this short tutorial, the functionalities are not working like they supposed to be. If you click on the actionlink, an ajax call should be executed and return a string on the same page. In my project he ren开发者_运维技巧ders a new page and returns a string. I follow the tutorial 2 times and could not find my problem. Many Thanks if anyone can help

rendering code html when the page opens

<p> Page Rendered: 15:00:09 </p>
<span id="status">No Status</span>
<br>
<a href="/Home/GetStatus" data-ajax-update="#status" data-ajax-mode="replace" data-ajax="true">Update Status</a>

code html when i click the link (this is in a new page)

<body>Status OK at 15:04:12</body>

you can find the program code in the link from the tutorial, because I copy pasted it. Only thing that changes is the view engine (razor)


i wouldn't even mess with the MSFT ajax stuff. jquery is the industry standard but there are other javascript libraries such as Moo and YUI. i can't imagine what benefits the msft library would have over these other ones.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜