Passing data from the called page(IFRAME) to the calling page

Hi,

I am calling an HTML page in a <IFRAME> control "Src" attribute. How can I pass some data from that page to the calling page?

 

Thanks,

Siddharth

 

 

 

0
Siddharths1
7/11/2007 7:52:56 AM
asp.net.web-forms 93655 articles. 6 followers. Follow

1 Replies
760 Views

Similar Articles

[PageSpeed] 5

As long as they are on the same domain (meaning, if your "calling page" is from www.SingingEels.com and your IFrame page points to www.google.com you can do nothing because that's Cross-Site Scripting)... anyway, as long as they are on the same domain you can do this in the child page:

<script type="text/javascript">

parent.document.getElementById("someSortOfDivOrWhatever").innerHTML = "Hey, it's me!!!";

</script>

or lets say you wanted to put some data into a hidden input field with the id "childInput"

<script type="text/javascript">

parent.document.getElementById("childInput").value= "This is from the child page";

</script>


-Timothy Khouri
http://www.SingingEels.com/
Developer / Architect / Author
0
Nullable
7/11/2007 11:18:53 AM
Reply:

Similar Artilces:

In a web page(c#), I want to call another page and come back to next instruction of calling page
In a web page(c#), I want to call another page and come back to next instruction of calling page. Called page have no web item , it has only c# codes. after executing of this page (by IExplore), I want the remaining lines of calling page to be executed. How can I do that? What are you trying to do? What is the second page accomplishing? Will the first page stay open and the second page closes? You might be able to use WebRequest and WebResponse to do what you want. Hey bro, since you say that the called page has no web items, why dont you put the code in the called pa...

how to know the calling page from called page.
hi, i need to know how to get the calling page from the called page even there is no post back has been done. Look at the ServerVariables, in particular the Referer i am having the linkbutton in the previous page called page1. while clicking the button the page is redirect to the current page called page2. now i want to know the name or url of the page1. how can i do???? As I already said.... HttpContext.Current.Request.ServerVariables("HTTP_REFERER") Thank You so much... it works very well.......

I do not want to refresh page to get latest data on it.Whenever I call my web page it must return latest data on it? How can I do that?
When I call my application web page it gets last executed page not actual page. I have to refresh page to obtain actual data on the page. I want actual data without refreshing.Whenever I call my application's web page it must bring me latest data on it. How can I do that? Thanks You can use ajax which will send an asynchronous request to the server and refresh partial page content. for more about ajax check below link www.asp.net/ajax HCHaissam Abdul MalakMCAD.NET| Blog |...

Passing Data From Child Page to Parent Page and calling close
Hi,  I am trying to pass data to do a post back on the Parent page, pass Data to be displayed on the Parent page and then close the Child Page at the same time but for some reason My code  is not working at all. I suspect I have some formatting issues in here. Can anyone please help me?? Thanks in Advance   Page.RegisterStartupScript ("close", "<script language=javascript>  window.opener.__doPostback();  window.opener.document.getElementByID('LblMessage').style.className = '" + csslook + "';  window.opener.docum...

difference of calling web services and calling web page
Dear all,  What is the difference of call a web services instead of calling a aspx page which is also programming can accept parameters and return results? Webservice -- Soap protocol Webapplication  -- HTTP protocol Webservices are of two Major types Xml & SOAP HttpWebServices Basic difference is in usage and implementation. We use a webservice inside a website. it is added as a reference or we can call it through HttpWebRequests and Response objects. Webpages are the components that have presentation and logic, while web services provide the service that we...

All web pages hang on web server when one of the web pages calls a run away sql query
Hi: We have a Windows 2003 dedicated web server running the .NET Frameworks 1.0 and 2.0.  We have a SQL Server cluster running SQL Server 2000.  Unfortunately, we do not have a test environment.  I have 2 .NET web sites in production.  My coworker has a voting .NET web page using AJAX on the same server.  The coworker wrote a query that was not indexing properly and when the page fired the query...the cluster went to almost 100% utilization.  My two web pages would hang and show a blank white page on the default.aspx.  Neither of m...

Which page has called a page
Hello, Is a page able to know which page has called it ? If Page_A and Page_B can call Page_C, I would want to know during Page_Load of Page_C if it is Page_A or Page_B which is the calling page ? Thank's Alain You could try using Request.UrlReferrer. This will give you the complete url, type: http://localhost/NetSamples/Employees.aspx To strip away everything unecessary like Querystrings etc. you could use something like this: Dim strReferrer As String = Request.UrlReferrer.ToString Dim intStart As Int32 = strReferrer.LastIndexOf("/") + 1 ...

Using data from the postback call on the calling page
Hi, I have the following issue: Main page has some simple controls (imagebuttons), which trigger a c# code, this code goes and gets some data from a device located at server side, a thermometer. So now the c# code has some arrays of values.  Now I would like to use that data on the page which called the callback. I know I can write the c# code necessary to update label controls and other stuff on the page, but I was wondering if there is an efficient way to pass that thata back to a javascript on client side, who would then reformat and update the page on client side... &nb...

how to call the data from one page the another page
i would like to call some particular record from one column of gridview from one page1 to another new page,for example:price column in page one,i would like to display the price column value in page2.any idea? Hello,   You can pass values from a gridview to another page using a hyperlink field for that particular column. Within the hyperlink control there is a value you can set in DataNavigateUrlFormatString.  I can remember the make up of the what u enter but search for that and there be loads of pages explaining.   Hope this helps. Kevin   i don really u...

Can my web page with a form submit to other web pages forms?
I was wondering if I created an aspx page that had a form on it that I could use the submit button to submit this form's contents to other web pages forms(servers accepting those form's data). I am thinking this would be a great way to update data on particular web pages without having to actually visit those similar web pages. Any ideas, examples would be much appreciated. Thanks in advance.  Yes you can.  It's called Cross Page Posting: http://msdn2.microsoft.com/en-us/library/ms178139.aspxAlso: http://msdn2.microsoft.com/en-us/library/ms178140.aspx might ...

I used Passing Server Control Values Between Pages, and tried to call the receiving page as the start page, this causes an error!
 The error states thatUnable to cast object of type 'ASP.homepage_hp_aspx' to type 'ASP.FirstPageClass'.and is pointing to thefp = (FirstPageClass)Context.Handler; in <script runat="server">        FirstPageClass fp;        protected void Page_Load(object sender, EventArgs e)        {            if (!IsPostBack)            {  &nb...

When Press F5 in my web page, it is making fresh call to the page and IsPostBack is false though after many click on button on same page
HI,  I am Using .net 3.5 and vs 2008. In my project there is a Master page also. Actually my problem is. when navigate to the Page say "Home.aspx",  IsPostback is false and relevant code is executed. After that Button1 is clicked in home page, this time IsPostback is true and corresponding code and Button1_click code is executed. In this situation F5 is pressed, as per the aspx lifecycle IspostBack is true and Button1_click must be executed. but in my case it is pretty diffrent, i.e IsPostback  is false and page is loading freshly as firstime request to the...

Passing data to popup page, form based in master page.........
I have a master page setup and in one of my pages I have a form. One of the buttons on the form opens up a popup window which allows users to look up details in a database and then I need to pass the data back to the parent page and populate the form. I'm trying to use javascript for the popup window and the passing of values. I have created a simple function   function lookupWindow() {     var lwin;     lwin = window.open("CustLookup.aspx","","HEIGHT=640, WIDTH=480, STATUS=YES");     lwin.document.form1.Text1.valu...

Calling an aspx page on form submission in another aspx page
I have 2 aspx pages called say page1.aspx and page2.aspx, and I am calling the second aspx page on submission of a form in the first page. Thus, I have the following code in page1.aspx <form name="frmtest" id="frmtest" method="post" runat="server" action="page2.aspx"> Now, when I submit the form, I am getting the following error message: The viewstate is invalid for this page and might be corrupted. Could anyone help me in this? Thanx in advance. Himanshu Hi, currently ASP.NET sets the action back to itself (...

Web resources about - Passing data from the called page(IFRAME) to the calling page - asp.net.web-forms

Resources last updated: 11/27/2015 4:38:52 AM