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?
Related
I have a .ascx page in when I redirect from another page, page_Oninit and Page_load events are occured and all controls loaded with initializecomponents().
But the page is not showing in the browser. Do you have any idea why this occur?
.ASCX is user control. When we add it into our page say 'Default.aspx' it becomes the part of that page but not whole page. So you can not use .ASCX as standalone. If you want to see it,you have to place it into some page and then only you can view it from browser.
I'm loading page inside div in another page..the problem is when I press LinkButton in the parent page to do postback, the postback goes to the sub page not to the parent one.
I'm using jQuery ajax to load the page:
$('#myDiv').html(refreshingDiv).load('subPagePath.aspx');
How do I solve this problem ?
You should not load the whole ASPX Page into the DIV because when you make a AJAX request to get an ASPX page from the server and load it into the DIV, actually some parameters like ViewState of the main page gets overwritten. Accordingly the ViewState will gets corrupted however if you load a HTML Page into a DIV, you can see it will be working fine.
So, Instead get the Data in the JSON Format and load in into the DIV accordingly
Hope it answers your question!!
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 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.
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.