zoukankan      html  css  js  c++  java
  • ASP.NET MVC2 in Action 读书笔记 [122] Ajax with MVC

    Index.aspx:

    <script src="../../Scripts/jquery-1.3.2.js" type="text/javascript"></script>
        
        <script type="text/javascript">
            function getMessage() {
                $.get("/SimpleAjax/GetMessage", function(data) {
                    $("#result").html(data);
                });
            }
        </script>
     
    <button type="button" onclick="getMessage();">Get the Message!</button>
    <div id="result"></div>

    SimpleAjaxController.cs:

    public class SimpleAjaxController : Controller
        {   
            public ActionResult Index()
            {
                return View();
            }
     
            public ActionResult GetMessage()
            {
                return Content("<h1>This is a custom message returned from an action.</h1>");
            }
        }
  • 相关阅读:
    ContentProvider
    铃声设置
    TTS技术
    http://www.w3cschool.cc/jqueryui/jqueryui-tutorial.html
    HttpHelper
    .net面试题
    函数和原型
    关于递增运算符
    CSS学习笔记
    CSS/CSS3 如何实现元素水平居中
  • 原文地址:https://www.cnblogs.com/RobotTech/p/2126934.html
Copyright © 2011-2022 走看看