zoukankan      html  css  js  c++  java
  • MVC 知识点学习1

    1、@Scripts.Render("~/bundles/kindeditor");@Styles.Render("~/Css/")   //(加载)引用bundles/kindeditor/kindeditor.js文件   @using System.Web.Optimization

    2、@Html.TextArea("Information", new { style = "800px;height:400px" })   (@Html.Raw())

    3、HashTable hash=new HashTable();    

         hash["id"]=1;   hash["url"]="../Home/Index";  

         return  Json(hash,""text/html;charset=UTF-8"");

    4、$.post('@Url.Action("GetSth")',{},function(data) {   标注:GetSth为相同Controler下面的方法

           if (data.msg) {
                alert("请求成功一次");
           } else {
                alert("请求次数过多");
           }
       });

    5、异步表单:

    1>>>>>

    @using (Ajax.BeginForm("GetDateTime", "Html", new AjaxOptions()
    {
         HttpMethod = "post", //传输方式
         OnSuccess = "suc", //加载成功调用的js方法
         OnFailure="err", //出错调用的js方法
         LoadingElementId = "imgLoad" //请求所现实的元素
    }))
    {
    <input type="text" name="txtName" />
    <input type="submit" />
    <div id="imgLoad">loding....</div>
    }

    2>>>>>

    <script type="text/javascript">

    function suc(resText) {
          alert(resText);
    }; 

    var xhr=new XMLHttpRequest();//ActiveXObject("Msxml2.XmlHttp");  ActiveXObject("Microsoft.XmlHttp");
    function err(xhr) {
           alert(xhr.readyState)
    }
    </script>

    3>>>>>

    public ActionResult GetDateTime()

    {
         string str =Request.Form["txtName"];
         System.Threading.Thread.Sleep(2000);
         return Content(DateTime.Now + "," + str);
    }

    IEnumerable<T> sources.Skip(pageSize * (pageIndex - 1)).Take(pageSize).ToList();

  • 相关阅读:
    node.js 建立live-server
    Django 反向解析
    Boost智能指针——weak_ptr
    boost::intrusive_ptr原理介绍
    shared_ptr 的使用及注意事项
    小感
    JQ对页面中某个DIV的大小变化进行监听
    使用java Apache poi 根据word模板生成word报表
    字节byte自适应转换为B、KB、MB、GB、TB
    jq实现 元素显示后 点击页面的任何位置除元素本身外 隐藏元素
  • 原文地址:https://www.cnblogs.com/yhhdream/p/4451205.html
Copyright © 2011-2022 走看看