当前位置:编程学习 > C#/ASP.NET >>

A页面向B页面传输大量数据,B页面把数据显示出来,并且2页面不能关闭

B页面接收逻辑是固定的
  protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            Encoding encoding = Encoding.UTF8;
            string title = HttpUtility.UrlDecode(Request.Params["article_title"], encoding);//标题
            string source = HttpUtility.UrlDecode(Request.Params["article_ContentFrom"], encoding);//新闻来源
            if (!string.IsNullOrEmpty(title))
            {
                Response.Write("<script>window.open('Test.aspx','_blank')</script>");
                string _NewsSource = source;
                string _NewsTitle = title;
                string _NewsAuthor = HttpUtility.UrlDecode(Request.Params["article_author"], encoding);//作者
                string _NewsContent = HttpUtility.UrlDecode(Request.Params["article_content"], encoding);//正文
                string _NewsDigest = HttpUtility.UrlDecode(Request.Params["article_leadin"], encoding);//摘要
                string _NewsKeyword = HttpUtility.UrlDecode(Request.Params["article_keyword"], encoding);//关键字
                string[] from = { _NewsSource, _NewsTitle, _NewsAuthor, _NewsContent, _NewsDigest, _NewsKeyword };
                GetNewsContent(from);
            }
        }
    }

    private void GetNewsContent(string[] from)
    {
        Title.InnerText = from[0].ToString();
        Source.InnerText = from[1].ToString();
        Author.InnerText = from[2].ToString();
        Content.InnerText = from[3].ToString();
        Leadin.InnerText = from[4].ToString();
        KeyWord.InnerText = from[5].ToString();
    }

Request.Params 4种数据
1.Query-string parameters. 

2.Form fields. 

3.Cookie。 

4.Server variables. 

1和3 应该没法用,因为数据比较多,1我试过了超过长度。
怎么把A页面大量数据传过去?我A页面数据时div 或者span里的 超长文章 --------------------编程问答-------------------- Response.Write("<script>window.open('Test.aspx','_blank')</script>");
这段可以无视。 --------------------编程问答-------------------- session?
或者存临时的XML中 取出之后把xml中数据清空。
补充:.NET技术 ,  ASP.NET
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,