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();

  • 相关阅读:
    Leetcode: Longest Absolute File Path
    Leetcode: Mini Parser
    Leetcode: First Unique Character in a String
    Leetcode: Lexicographical Numbers
    Leetcode: Shuffle an Array
    Leetcode: Ransom Note
    Leetcode: Linked List Random Node
    Socket网络编程--聊天程序(7)
    Socket网络编程--聊天程序(6)
    Socket网络编程--聊天程序(5)
  • 原文地址:https://www.cnblogs.com/panshengqiang/p/2796687.html
Copyright © 2011-2022 走看看