我现在有A页面有一些div里有一些内容,我现在想要把这些内容提交到B页面,在B页面显示出来该怎么做。
B页面要有A页面的数据并且要保持打开状态
我试用jquery ajax post 数据过去了,但是B页面没有显示,等于白搭,该怎么办呢!跪求!
function CommitToCMS(title, source, author, content, leadin, keyWord) {
            //window.open("Test.aspx?article_title=" + title + "&article_ContentFrom=" + source + "&article_author=" + author +
             "&article_content=" + content + "&article_leadin=" + leadin + "&article_keyword=" + keyWord);
                                    $.ajax({
                                        type: "Post",
                                        url: "Test.aspx",
                                        data: "article_title=" + title + "&article_ContentFrom=" + source + "&article_author=" + author +
                                                 "&article_content=" + content + "&article_leadin=" + leadin + "&article_keyword=" + keyWord,
                                        complete: function (msg) {
                                                                                   }
                                    });
        }        $(function () {
            $(".CommitToCMS").click(function () {
                var $li = $(this).parents("li");
                var title = $li.children("div:eq(1)").find("a").html();
                var source = $li.children("div:eq(3)").html();
                var author = $li.children("div:eq(4)").html();
                var content = $li.children("span:eq(0)").html();
                var leadin = $li.children("span:eq(1)").html();
                var keyWord = $li.children("span:eq(2)").html();
                CommitToCMS(title, source, author, content, leadin, keyWord);
            });
        });
不能拼 url因为A页面内容太多超出querystring范围了
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))
            {
                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();
    }

解决方案 »

  1.   

    当A通过ajax来请求B时,它对已打开的B页面不会产生任何影响的!A与B页面之间有关系么.
    譬如是A弹出的子窗口B
    或者点击A页面,打开新页面B
    或者反过来也可以.如果A与B之间没有联系.那可以将A页的数据保存在COOKIE
    B页面通过javascript定时读取cookie中的值.
      

  2.   

    是一篇文章,可能夸张的长,cookie大小可能不够。
    就是a页面有文章,一键然后b页面也出现这篇文章。b页面的逻辑 就是上面的c# code
      

  3.   

    querystring 受到长度限制
    post过去么 b页面又不会打开的
      

  4.   


    打不开新页面?设置form的action
      

  5.   

    如果把数据传到B 用B的逻辑介绍 见上c# code。然后B还要打开状态,看到数据在 Title.InnerText 出现
      

  6.   

    在a页面的form上设置action 为b页面