I am seeking a solution to redirect the entire window to another page when clicking a link inside an iframe. It is important that it redirects the entire window, not just the iframe itself. Is this even possible?
I would prefer to implement this in JavaScript or ASP.NET if at all feasible.
UPDATE: When I attempt the suggested solutions, I find that I get redirected to the source of the iframe instead of the site where the iframe is located. Let me provide you with the code snippet:
function redirectToPage() {
window.top.location.href = "./News.html";
}
Since I want the code to be adaptable and not static so that I can use it across multiple pages without having to edit the URL each time, I am looking for a way to achieve this, perhaps by fetching the URL from a database. Any suggestions? Also, I forgot to mention earlier that the pages are hosted on different domains which could potentially pose some challenges.