虽然年龄大了,也要从头学起 MVC JQuery的Ajax应用测试(四)

来源:互联网 发布:linux getopt函数 编辑:程序博客网 时间:2024/04/30 12:19

第一步:Index.cshtml客户端代码:

@{    ViewBag.Title = "Index";}  <h2>Partial Rendering Test</h2><input id="cb" type="checkbox" /><div id="outarea"></div>@section scripts{    <script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")"></script>     <script type="text/javascript">          $(function () {              $("#cb").bind("click", function () {                      $("#outarea").load("/content/ccss.html");                  });                  })    </script>}

第二步:在Content目录下创建一个ccss.html局部视图文件,内容为:

<p>I'm here!</p>



0 0
原创粉丝点击