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

  • 相关阅读:
    3:Exchange2016图形化安装和无人值守安装
    hdu 3980 Paint Chain (sg)
    hdu 1850 Being a Good Boy in Spring Festival (Nim)
    zoj 2971 Give Me the Number
    hdu 1847 Good Luck in CET4 Everybody! (sg)
    hdu 1754 I hate it (线段树)
    poj 1704 Georgia ans Bob (StaircaseNim)
    hdu 1907 John (Nim变形)
    hdu 1536 SNim (sg)
    hdu 1166 敌兵布阵 (线段树)
  • 原文地址:https://www.cnblogs.com/panshengqiang/p/2796687.html
Copyright © 2011-2022 走看看