test.aspx.cs中加入函数private string GetContentFromUrll(string _requestUrl)
    {
        string _StrResponse = "";
        HttpWebRequest _WebRequest = (HttpWebRequest)WebRequest.Create(_requestUrl);
        _WebRequest.Method = "GET";
        WebResponse _WebResponse = _WebRequest.GetResponse();
        StreamReader _ResponseStream = new StreamReader(_WebResponse.GetResponseStream(), System.Text.Encoding.GetEncoding("UTF-8"));
        _StrResponse = _ResponseStream.ReadToEnd();
        _WebResponse.Close();
        _ResponseStream.Close();
        return _StrResponse;
    }protected void Page_Load(object sender, EventArgs e)
    {
        Response.Write(GetContentFromUrll("http://xxx.com/test.xml"));
    }

解决方案 »

  1.   

    和输出静态页面 差不多吧?关注  
    http://www.baidu.com/s?wd=ie%D6%D0%CF%D4%CA%BExml&cl=3
      

  2.   

    我的思路是ds.readxml
    然后拼串  输出到页面。
    无视我吧,我来看LS的答案
      

  3.   

    Response.Clear();
    Response.ContentType = "text/xml";
    Response.WriteFile("xx.xml");
    Response.End();
      

  4.   

    Response.Clear();
    Response.ContentType = "text/xml";
    Response.WriteFile("test.xml");
    Response.End
      

  5.   

    使用xml控件
    <asp:Xml id="Xml1" DocumentSource="test.xml" runat="server" />
      

  6.   

    非常感谢孟老的回答,但是现在还需要请教一个问题,在您给我的那个例子中WriteFile不能使用网络上面的地址,例如:http://xxx.com/test.xml,请教如何解决呢?