设置aspx页面查看时,只是展示出想要的内容,不含其它元素。也就是实现这样的效果。
https://www.lookango.com/service/cardapi.aspx?FunctionID=GetCardEncodes&HashCode
=2342asdfdfade3asf2342&UserID=11&OrderID=200802010001&CardKindID=9
右键查看源文件,只是含有xml内容,而不含其它的元素
--------------------------------------------------
而我的页面生成后查看源文件生成的是:
<?xml version="1.0" encoding="utf-8" ?><string xmlns="http://tempuri.org/"><LKG_CARDAPI_RETURN_HEADER><OrderID>200802010001</OrderID><HashCode></HashCode></LKG_CARDAPI_RETURN_HEADER><Errors><ErrorID>315</ErrorID><ErrorDescription>TicketCount不正确</ErrorDescription></Errors></string>
 
<!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 id="Head1"><title>
测试
</title></head>
<body>
  
</body>
</html>
------------------------------------------
怎样不下半部分去掉??请各位高手帮忙。

解决方案 »

  1.   

    (1) Response.End()
    (2) 在页面上把多余的 HTML 标记删除。
      

  2.   

    用正则把所有的HTML标签删除
    http://www.cnblogs.com/mishy/archive/2008/01/03/1024953.html
    http://hi.baidu.com/xiejiang880426/blog/item/2bac563a06cf46e015cecbd9.html
      

  3.   


    protected void Page_Load(object sender, EventArgs e)
        {        
            Response.Write("<div class=\"result_line2\" onmouseover=\"list_over(this)\" onmouseout=\"list_out(this)\" onclick=\"addFundCode('550001')\">550001 信诚四季红</div>");
            Response.Write("<div class=\"result_line2\" onmouseover=\"list_over(this)\" onmouseout=\"list_out(this)\" onclick=\"addFundCode('550002')\">550002 信诚精萃成长</div>");
            Response.Write("<div class=\"result_line2\" onmouseover=\"list_over(this)\" onmouseout=\"list_out(this)\" onclick=\"addFundCode('550003')\">550003 信诚盛世蓝筹</div>");        Response.Buffer = false;
            Response.Flush();
            Response.End();
            Response.Close();
        }