Javascript - Redirecting The Whole Page From Script Inside Iframe?
Feb 22, 2011
Im looking for a way to redirect to another page, when i click a link in the iframe. i dont want just the iframe to redirect, but the whole window.
is this possible?
preferably in javascript or in asp.net if possible
EDIT: When i try the answers i get redirected to the source of the iframe, not to the source of the site the iframe lies on... Ill show you the code
function redirect() {
window.top.location.href = "./Nyheter.html";
}
As i dont want the code to be static, so that i can use it on many pages without changing the url, i want to do it this way, alt. get the url from db... but preferrably this way, Solution? Also, forgot to mention. The pages are not on the same domain, they are on different ones..
I have a web application that's really quite simple. I have a MainMenu.aspx that contains a asp:Menu control and an IFrame. This IFrame will contain other aspx pages based on the selection from the menu.
My question is this: When I have selected a menu option and a specific page has loaded into the IFrame and this new page has a "Cancel" button that simply goes back to the MainMenu.aspx page. How would I code that in the VB.Net code-behind file of this page? I'm assuming it would be in the BT_Cancel_Click() event but I'm not sure how to code it!
I have a default.aspx page with an iFrame that displays another "main.aspx" page.
The main.aspx page has some buttons and other controls .. and some events associated to page load and so on .. When i open main.aspx in a browser, evrthg works perfect .. but when i open up defaults.aspx , evrthg loads correctly, but if i click on any button inside "main.aspx" , nthg happens .. and none of the events is triggered ..
I have an iframe in .aspx page , in which i open an html page(local) and I want to postback my .aspx page when user click on an img( that is in html page ) and get that image id on server side.
I have a Parent Page that includes an iframe containing html page with many field. The parent page contains the "Save" button. Now i want to get the values of iframe page while submitting the parent page. How can i access the iframe pages fields in parent page submit?
I have a registration page I enter the details of the customers and redirect to another page for capturing photo and I come back to the registration page. Â I want to retain all the values i entered when i land on the registration page. Â
There is one master page in my application. Left side it display menu and right side there is a Iframe where page will be displayed when user click on menu. so entire page will not be refreshed only Iframe will be refreshed.
Everything is working fine for me but I am facing problem when session expire, my loginUrl page display inside Iframe so user is able to see left menu.
I am thinkin that LoginPage should be display in main screen instead of Iframe.
In an .aspx page with the vb.net codebehind i am using IFRAME , which would be created inside the repeater control. Since i want to resize the IFRAME based on the content within the page i have been using the resize function Obtained from here on the IFRAME onload as shown below.
However it is throwing the error as the method could not be found in the form. Is there any client side script variant for the onload event? May i know,What might be the reason for the error and its solution?
I have a website with a menu, when menu item is clicked I display the page for that menu in an iframe(iframe is set to display home page initially by default). sometimes it could take few seconds to display the page for the selected menu item (for example reports) and I would like to display a loading image while the page is loading. how to do this using javascript or jQuery
I'm using Form Authentication in my web application.In my application I have a lot of pop up windows that include form inside.when the form ticket expires the user is redireced to Login page.Also it happens inside a popup window. If user leaves the pop up open and come back after the ticket is expired, it redirects him to the Login inside that pop up.
i open a iframe in a page, from that page opend in iframe, i want the page url.means one page mainpage.aspx have a iframe, that iframe open open a iframepage.aspx page.from the iframepage.aspx page's button click event i want to referesh the mainpage.aspx page.how can i do.
I have a content page (<asp:content>) where I am using javascript and normally I am adding the attribut in the code-behind page. however I now need to add a javascript function that will cause when the body or panel loads. I have a test javascript function that simply shows an alert box but I cannot get it to display. Is there a special way to do this in a content page?
I have 1 ModalPopupExtender inside a UserControl. Everything works great until I start adding the same usercontrol to the page. I am getting this error message in the javascript console::
Message: Sys.InvalidOperationException: Two components with the same id 'MPE1' can't be added to the application. I understand the error, it obvious that the framework wants unique IDs. What I can't figure out is how to give them unique name.
I have a JavaScript function in .aspx page and also panel.something like given below
//In .aspx page script type  <script type="text/javascript">   function ss(a,b,c){   window.open("default.aspx")   }   </script> ... .... .... <asp:Panel ID="pan" runat="server"></asp:Panel> //end .aspx page //In vb page pan.Controls.Add(New LiteralControl("<tr><td><img src='images/1.gif' width='14px' height='14px'></td></tr>"))  pan.Controls.Add(New LiteralControl(" <a onclick='ss(1,'aaaa',1)' href=#>hello</a>")) pan.Controls.Add(New LiteralControl("</table>"))//end vb page
when i pass only integer it works,but when i pass string value it stops working.....
I want to implement it with ajax in the following way:
when user click out side of iframe dont postback page and change the src of iframe .I want to show the progress inside the progressupdatepanel
I mention it I dont want to run any postback just loading page inside the iframe with ajax by calling outside of iframe for example there is a button in the page and it is handled by update panel and it loads the content of other page inside the iframe.
We are looking at integrating a full-blown GWT (Google Web Toolkit 2.0) application with an existing ASP.NET 3.5 application. My first gut reaction is that this is a horrible frankenstein idea. However, the customer has insisted that we use this application developed by a third-party.
I have almost NO CONTROL over the development of the GWT app.
My first thought is to actually attempt to embed this in an iFrame. Because GWT is running under Tomcat/Jakarta, it is hosted on a different server from the .NET app so the iFrame src will be to a URL on the other machine.
I need to utilize our own ASP.NET authorization scheme to restrict access to the embedded GWT application. The GWT app also uses embedded java applets, which don't seem to be working right now inside the iframe. The GWT app makes calls to a backend server (using GWT-RPC?).