Is it possible to hyperlink from one page in iFrame to a target in the other other page - iframe

Here is a page using frames, in which links in the lefthand page go to targets in the righthand page: https://webarchive.nla.gov.au/wayback/20120323204015/http://www.humanities.mq.edu.au/Ockham/1stRd.html
If I change to iFrames, is it possible to link from one page to the other?

Related

In aspx with mvc 4, how to modify layout pages slightly on opening of a new page

When an htmlActionLink is clicked, a new page (say About) is opened with layout and the main body is rendered from the corresponding view. I want to change the style of the about link to show that this link is active. I tried a lot using jquery. It changes momentarily, but it comes back to its original style. I have not tried it through controller. I've used jquery in the layout.cshtml and about.cshtml page.
Look in to MvcSiteMap. You can use the MVC helpers to create a navigation menu that changes as you visit pages. Also, keeping it server side over using jQuery is going to be the best bet.

change div content in master page on aspx page

This is a simple question, or not. I have a master page which has three sections, in one section is a logo gallery. There are certain pages in the site i would like to inject text in that area and remove the image gallery, can this be done with jquery in a section within a master page?
One option is to access to master page programmatically in your code-behind.
Like this:
http://msdn.microsoft.com/en-us/library/c8y19k6h(v=vs.100).aspx
On the pages where you don't want to see the image gallery, you could set visibility of that control to false.
If you really want to change the content with jQuery after the page is loaded (like after clicking a button), you can do that pretty easily. See this fiddle for a working example.
$("#button1").click(function() {
$("#section1").html("new content");
});​

load page and iframe simultaneously through javascript

I had a page(Home.aspx) containing menu on the top and another master page, with same menu on the top.
Now, when i have to move from Home page to master page, i use
window.location = 'test.aspx';
Now, when i need to move from master to main(Home) page, i need to call a function with a parameter, containing control url, which has to be loaded to the iframe in the Home page.
Can anybody suggest how can i load Home page and iframe within simultaneously using javascript.
If you don't want the user interact with the page until the iframe is loaded, you can disable the page with javascript (onLoad of the page <body onload="disablePage()">) and enable again when the Iframe is loaded (onLoad of the Iframe <iframe onload="enablePage()"... )
Here some post about disable or gray out page: CSS/JavaScript Use Div to grey out section of page

How to avoid refreshing of masterpage while navigating in site?

In my website, I have created a masterpage and attached all of my pages to it.
My masterpage structure contains a header and a footer. On the left it has a treeview control, which i have attached to all my pages, and on the right there is a contentplaceholder to show the content of respective pages.
My problem is that when I click any link in the treeview it refreshes the whole masterpage and open the respective page. I wish to avoid this refresh. Means it should show the contents of page on right side contentplaceholder without refreshing the whole page.
I have seen people suggesting to use iframes. But for using iframes I shall have to restructure my website. Is there any other solution than iframes and with minimal changes to the work that I have done?
You will probably want to look at using AJAX to stop this from happening. You will want to read up on using an UpdatePanel. Below are some good articles that goes over this:
http://geekswithblogs.net/ranganh/archive/2007/05/11/112405.aspx
http://msdn.microsoft.com/en-us/library/bb399001.aspx
You also have the option of using jQuery to handle your AJAX calls. While I typically prefer the use of jQuery when using AJAX, I am not sure I would use it in your situation. If you would like to look at what it offers take a look at these links:
http://api.jquery.com/jQuery.ajax/
http://sixrevisions.com/javascript/the-power-of-jquery-with-ajax/
You could put the content you wish to change inside an asp:UpdatePanel that way that will be the only thing that is repainted (it uses AJAX under the hood):
http://msdn.microsoft.com/en-us/library/system.web.ui.updatepanel.aspx
The master page class derives from the UserControl class and the master page is like a child control. So we can say that master page is not a true page, when a page loads we can notice the navigation URL in the address bar is the content page's but not the master page! so we cannot refresh a content page without refreshing master page.
there is one way to avoid flickering the page by adding the code in < Head > section in the masterpage.
<meta http-equiv="Page-Enter" content="blendTrans(Duration=0)"/>
<meta http-equiv="Page-Exit" content="blendTrans(Duration=0)"/>

Stop Master page refreshing while navigating between pages?

I'm using Master Page in my ASP.net application, in the master page I put a ContentPlaceHolder in Update Panel to support AJAX in child pages, the question is how to stop Refreshing "master page controls" while navigating between pages?
For navigation between pages I tried to use Response.Redirect, windows.location java script with no success, shall I use the Frames or IFrames instead of Master Pages to stop Refreshing?
any suggestion to solve this issue will be highly appreciated, Thanks in advance...
If you don't want the page to refresh when switching between "pages", you will not have any good solution using master page. As others have said in different words, the master page is just a common "template" that is used by different pages. The navigation between is just like calling different pages, and of course will reload the entire page, including the master page content.
A sollution I have used with Ajax is
to have each "page" as a user
controls, and put them all in an
UpdatePanel with visible="false".
Then for navigation between "pages", switch
visibility for the user controls
to show the right "page" control.
The alternative is to use iframe.
Neither of these solutions use MasterPage.
The MasterPage concept was designed to simplify a common look before Ajax was introduced in ASP.NET. After Ajax became popular, the demand for not refreshing the entire page has been more common.
A masterpage is nothing more than extending your "normal" page with (most of the time) the default layout of your application. The master page and the contentplaceholders are rendered as a full html page. When you navigate between pages it is the normal behavior that your whole page refreshes. This is how the web works.
Working with an iframe could solve your problem. However that has some other side effects:
The whole masterpage isn't useful anymore. The content around your iframe is the "masterpage".
With a masterpage you actually browse to another url, you also see in the url bar of your browser. When you work with an iframe you navigate within the iframe to another page. The url in your browser will stay the same. When the user of your application hits the refresh button it always starts again at the default page you assigned to your iframe in the html. Of course there are some workarounds
Anyway. It really depends on your application. There are multiple solutions to work around the refresh behavior.
Having a structure like the one you've explained:
Master
Child page 1
Child page 2
...
Then you cannot prevent the page from refreshing when you switch from page 1 to page 2 etc. for you have a single "page" entity (master content + selected page content) when it's rendered to the browser.
If you want to switch betweent different app views inside the very same page (so to prevent a complete page refresh) you could use a single page (the Master becomes quite useless) with an updatePanel in which you load the different views.
You can also use iFrames, but if you have to handle any type of communication between different parts of the page (some of which are inside iFrames) I would personally advice not to use them.

Resources