zoukankan      html  css  js  c++  java
  • .net中ajax前台使用

    我是在开发时候使用的,受一个功能点的需求,使用了ajax,最为基础的方法。如下的方法:

    从前台界面获取NEWSERIAL控件的内容,通过ajax传递参数NEWSERIAL到页面ajax.aspx。然后在ajax.aspx页面接受NEWSERIAL做处理,可以使用Session等操作储存值使用的。

       function myAjax(){
             var postData="NEWSERIAL=0";
             postData = "NEWSERIAL=" + document.getElementById('S_NEWSERIAL').value + 'ω' + document.getElementById('S_OLDSERIAL').value;
                    var xmlhttp=null;
                           xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
                           xmlhttp.open('POST', 'ajax.aspx' , false);
                           xmlhttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
                           xmlhttp.send(postData);

                          if(xmlhttp.readyState==4)
                          {                     
                            data=xmlhttp.responseText;
                          }
            }

    aspx.cs

      string str= Request.Params["NEWSERIAL"] == null ? "" : Request.Params["NEWSERIAL"].ToString();

  • 相关阅读:
    redis-LinkedList
    Jedis(java操作redis数据库技术)
    jquery判断表单内容是否为空
    jQuery单选框的回显
    使用jQuery重置(reset)表单的方法
    BootstrapValidator 解决多属性被同时校验问题
    模态框被遮罩层遮挡
    python 高阶函数
    python 函数式编程
    python 生成器
  • 原文地址:https://www.cnblogs.com/panshengqiang/p/2796687.html
Copyright © 2011-2022 走看看