• 第一个XMLHTTP测试成功![原创]


    testxmlhttp.html
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head>
        
    <title>XmlHttp测试</title>
        
    <script type="text/javascript">
        
    function testxml()
        
    {
            
    var xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
            xmlhttp.open('POST','xmlhttp.aspx
    ?name='+document.getElementById('Text1').value,false);
            xmlhttp.send();
            alert(xmlhttp.responseText);
        }

        
    </script>
    </head>
    <body>
        
    <input id="Text1" maxlength="20" type="text" />
        
    <input id="Button1" type="button" value="button"  onclick="testxml()"/>
    </body>
    </html>
    xmlhttp.aspx没有内容
    xmlhttp.aspx.cs
    using System;
    using System.Data;
    using System.Configuration;
    using System.Collections;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    using System.Web.UI.HtmlControls;

    public partial class xmlhttp : System.Web.UI.Page
    {
        
    protected void Page_Load(object sender, EventArgs e)
        
    {
            
    if (Request.QueryString["name"!= null
            
    {
                Response.Clear();
                Response.Write(
    "您好:"+Request.QueryString["name"].ToString());
                Response.Flush();
                Response.End();

            }

        }

    }


  • 相关阅读:
    Debate
    图形算法
    OpenGL Notes
    How to Write an Ethics Paper
    Thesis
    addWindowListener -> WindowAdapter -> windowClosing
    Thesis
    Bootcamp: An error occurred while partitioning the disk
    What Is XML Schema
    What Is XML
  • 原文地址:https://www.cnblogs.com/ghx88/p/426216.html
Copyright © 2020-2023  润新知