I have a master page with a menu and an Iframe. When I click on the menu items pages are loaded inside the iframe. On each page I'm checking for the logged in user sessions and if they are null I'm redirecting the user to the Login.aspx page.
My issue is when the sessions are null page is redirected to the Login.aspx but it's loading inside the
iframe. If the sessions are null I need the user to be redirected to the Login page with out loading inside the iframe.
This is the normal behaviour of an iframe. The 'target' property of a link can be used to escape this, like
Escape!
If you want to do it in a redirect, try this link:
http://classicasp.aspfaq.com/forms/how-do-i-change-the-target-frame-or-window-of-a-response-redirect.html
If you always want a form to redirect out of the iframe, you can set the target property of the form you're posting back from.
Related
I have an aspx page: Main.aspx which has several components that cause
a postback. In the page Main.aspx I also have an iframe which contains
a multi-page pdf file.
The problem I am facing is that whenever the user does an action which
causes a postback on the main page Main.aspx, the page posts back and
the pdf file in the iframe is reloaded. This is a problem becuase if
the user has rotated or magnified the page then that is lost.
Is there anyway that the content in the iframe is not refreshed?
Is it possible to submit a form from a page to another page that has an iframe ? The page with iframe inside already has a submit form that submits to iframe.
So, I need page A to submit to page B which submits to iframe within.
No, you can do one of two things:
The one that makes the most sense is to submit directly to the URL of the iframe within Page B
You can also include the iframe on page A, and place a target attribute on the form itself to submit to the iframe.
The way you have it set up, with the man in the middle, won't work. Most browsers won't let you automatically submit a form without some sort of user interaction, like a mouse click or keyboard event.
I'm displaying a form within an iFrame.
The form is from another site which I don't control.
Once the form is submitted (via the submit button), I would like the user to be taken to the resulting page but don't want them to have to view that resulting page within the iFrame.
Currently, that 2nd page loads within the iFrame too.
How do I have it break out of the iFrame upon submit?
I'm doing all this on a wordpress page.
JH
I have an asp.net page_load event.
When the user clicks the back button of the browser I want to set some values in the page_load event.
The problem is that when I click on the back botton the page is rendered from Cache and the page load event is not fired.
What should I do so that page_load gets fired ...other than forcing the browsers cache to clear ?
If I understand you correctly you have the following situation:
User visits page A.
User clicks a link and visits page B.
User clicks the back button and page A is displayed again. It is displayed from the browser cache, instead of being refetched from the server.
Is that right? In that case you should mark the page as no-cache. With the Response.CacheControl property you can decide what caching options are returned in the http header of the response.
I came up with a solution.
Indeed the back button has nothing to do with the server events...the page is directly renedered from the browser cache.
So what I did was that I ran a script on the page load but not ASP's page load ,rather the javascript page load.
Whenever the back button is clicked the JS page load would be raised.
I have a page showing all products in a gridview.
I have a link in the page clicking on it opens a modal window.
In the modal window there is a form to enter product and save.
When I fill the form and save product I need to make the parent page to be refreshed so that
the new product is listed in the gridview and a message will be shown in a label in the modal window. I need to refresh the product list page without closing the modal window.
How to do it?
Please help.
You can refresh it with the following JavaScript:
window.opener.location.reload(true);
window.opener.location.reload(true);
true makes sure that the page is reloaded from the server instead of the browser's cache.
This will work only if the second page was opened by the first page using javascript and not when you open a link in the first page in a new window - window.opener will be null in the later case. Even in the former case, Firefox will throw a 'permission denied' error if both pages are not from the same domain.