Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Open New Window from Link In IFrame using HTML Action Link

Posted on 2013-06-28
2
Medium Priority
?
1,238 Views
Last Modified: 2013-07-07
We are embedding and iFrame in our page which contains links written in Asp.net MVC
frame work. I need to open these links, located in the IFrame in a new window, but
have not been successful with this.
I have tried the following listed below...
But, the links will not break out of the IFrame.        


  <%: Html.ActionLink("Not Registered Yet?", "Register", new { target="_blank" })%>
          <%: Html.ActionLink("Not Registered Yet?", "Register", new { rel="_external" })%>

Thanks
0
Comment
Question by:LT1415
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 1500 total points
ID: 39285993
This code will break you out of an iframe and put your page in place of the parent page but it won't open a new window.  I don't know if you can do both at the same time.
<script type="text/javascript">
<!--
if (top.location!= self.location) {
		top.location = "http://www.yoursite.com/yourpage.html";
	}
//-->
</script>

Open in new window

0
 
LVL 11

Expert Comment

by:lenordiste
ID: 39286680
you could also try to add this to the head section of your iframe:
<base target="_blank" />

Open in new window


this will open all links in a new window. Here is some info:
http://www.w3schools.com/tags/att_base_target.asp

Open in new window

0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will show, step by step, how to integrate R code into a R Sweave document
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question