我现在有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();
}
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();
}
解决方案 »
- 【求助】关于图片重写的
- 为什么要求做删除游览器历史记录,望高手指教!!
- DAL,BAL等三层架构类库应在放在哪里最好?
- asp.net中能否写程序更改HTTP请求头???
- 真诚求教! 100分,请教1个初级问题,求标准最优答案.
- 求助各位大侠,那位用过支付宝,我这出现点问题 希望大家帮助解决 急!
- .net 里更改XML文件(encoding="GBK")时出现如下错误,.net frame 不能找到相应字符集,当XML文件(encoding="GB2312")时保存就没问题
- Gridview内控件值取得问题
- 急求一句正则匹配代码
- asp.net 身份验证的问题
- 使用RDLC报表 饼图因为数据多显示密集采用了CollectedStyle属性。但会出现颜色一样。
- asp.net中一个A页面(没打开),一个B页面(打开),A页面后台如何给B页面中Label赋值???
譬如是A弹出的子窗口B
或者点击A页面,打开新页面B
或者反过来也可以.如果A与B之间没有联系.那可以将A页的数据保存在COOKIE
B页面通过javascript定时读取cookie中的值.
就是a页面有文章,一键然后b页面也出现这篇文章。b页面的逻辑 就是上面的c# code
post过去么 b页面又不会打开的
打不开新页面?设置form的action