惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

腾讯CDC
Microsoft Azure Blog
Microsoft Azure Blog
B
Blog
S
SegmentFault 最新的问题
WordPress大学
WordPress大学
P
Proofpoint News Feed
Hugging Face - Blog
Hugging Face - Blog
MyScale Blog
MyScale Blog
A
About on SuperTechFans
雷峰网
雷峰网
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
T
The Blog of Author Tim Ferriss
MongoDB | Blog
MongoDB | Blog
博客园 - 【当耐特】
The Cloudflare Blog
F
Fortinet All Blogs
小众软件
小众软件
博客园 - 三生石上(FineUI控件)
宝玉的分享
宝玉的分享
罗磊的独立博客
量子位
有赞技术团队
有赞技术团队
V
V2EX
Engineering at Meta
Engineering at Meta

博客园 - 许晓光

四舍五入 - 许晓光 - 博客园 ASP.NET 2.0 - 控件系列(四) – GridView绑定 - 许晓光 ASP.NET Video Streaming 在线视频播放 - 许晓光 C#调用dos命令 SQL – Select查询的多种方法 ASP.NET MVC 学习心得 (6) –jQuery取得控件值 - 许晓光 ASP.NET MVC 学习心得 (4) – 视图控制器 ASP.NET 事件冒泡技术 ASP.NET MVC 学习心得 (3) – 怎样使用服务器控件 ASP.NET MVC 学习心得 (2) - 怎样创建自定义URL Routing ASP.NET MVC 学习心得 (1) - 怎样创建简单程序 一个非常简单的C#面试题 C# Object Initialization SQL Server 性能优化(4) – Performance – Indexed Views SQL Server 性能优化(3) – Performance - DataTypes SQL – Sub Query SQL - TOP ASP.NET – Master Page 和Content Page事件执行顺序 ASP.NET 中使用Windows Live ID 验证登录
ASP.NET MVC 学习心得 (5) –AJAX - 许晓光
许晓光 · 2009-04-21 · via 博客园 - 许晓光
  1. 添加视图

    <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script language="javascript" type="text/javascript" src="/Scripts/jquery-1.2.6.min.js"></script>

    <script language="javascript" type="text/javascript">

    function HelloJquery()

    {

    $.ajax(

    {

    url: "HelloJason",

    type:"POST",

    datatype : "json",

    timeout : 1000,

    success: GetResult

    }

    );

    }

    function GetResult(result)

    {

    alert(result.toString());

    }

    </script>

    <h2>Async</h2>

    <input type="button" value="Get Server Data" onclick="HelloJquery()" />

    </asp:Content>

  2. 添加控制器

    public ActionResult HelloJason()

     {

    return this.Json("From server");

}

posted @ 2009-04-21 10:51  许晓光  阅读(228)  评论()    收藏  举报