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

推荐订阅源

G
Google Developers Blog
WordPress大学
WordPress大学
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
小众软件
小众软件
人人都是产品经理
人人都是产品经理
美团技术团队
Blog — PlanetScale
Blog — PlanetScale
S
SegmentFault 最新的问题
博客园 - 【当耐特】
V
V2EX
Microsoft Azure Blog
Microsoft Azure Blog
博客园 - 叶小钗
Google DeepMind News
Google DeepMind News
量子位
罗磊的独立博客
月光博客
月光博客
N
Netflix TechBlog - Medium
大猫的无限游戏
大猫的无限游戏
博客园_首页
P
Proofpoint News Feed
Jina AI
Jina AI
云风的 BLOG
云风的 BLOG
博客园 - 司徒正美
腾讯CDC

博客园 - 许晓光

四舍五入 - 许晓光 - 博客园 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)  评论()    收藏  举报