简体   繁体   English

如何将数据从一个iframe发布到另一个页面上的另一个iframe

[英]How to post data from an iframe to another iframe at a different page

I have a web calendar module will be work inside of an iframe in page-b. 我有一个网络日历模块,可以在page-b的iframe中使用。 It contains 1 page with two sections. 它包含一页,分为两个部分。 When you enter the zipcodes and housenumber, it hides the inputs and shows the calendar. 输入邮政编码和门牌号时,它会隐藏输入并显示日历。 Works with asp.net 与asp.net一起使用

The user wants also an input widget to his homepage. 用户还希望在其主页上输入小部件。 So I made an html widget page and will give the customer inside of an iframe too. 因此,我制作了一个html小部件页面,并将客户也放置在iframe中。

My question is how can I post the inputs (inside of an iframe at page-a) to the iframe at another page (inside of an iframe at page-b) 我的问题是如何将输入(在页面a的iframe内部)发布到另一页面(在页面b的iframe内部)中

My language is aspx and the customer is using a php cms (I think joomla). 我的语言是aspx,客户使用的是php cms(我认为是joomla)。 I saw some suggests says put the name of iframe inside of a target property like this: 我看到一些建议说将iframe的名称放在目标属性中,如下所示:

<form id="kalenderForm" action="page-b.php" target="iframe_name" method="post">

But the thing is I also have to write target="_top" to get out of the iframe in the first place I think. 但是事情是我还必须首先编写target =“ _ top”才能脱离iframe。

Any suggestions, that would be really helpful.. Thanks in advance 任何建议,将是非常有帮助的。

OK. 好。 If I understand this right I think you just want to use sessions. 如果我了解这项权利,我认为您只想使用会话。 The widget works when it is on the page but you want it to also show the calendar when the widget is on a different page. 该小部件在页面上时可以工作,但是您希望它在其他页面上时也显示日历。 So once the user has entered their address and you show the calendar, you want them to continue to see their calendar any time they see the widget instead of the address form. 因此,一旦用户输入了地址并显示了日历,便希望他们在看到小部件(而不是地址表单)时继续看到他们的日历。 The user session should be maintained from page to page. 用户会话应逐页维护。

So in your calendar.aspx you would have something like 因此,在您的calendar.aspx中,您会看到类似

psuedo code 伪代码

if( post.formData ) {
  ... db stuff
  session.showCalendar = true
}

if( session.showCalendar ) {
  ... calendar html stuff ...
} else {
  ... show form html ...
}

clearly I am not as asp guy 显然我不是asp的家伙

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM