DotNetNuke iframe module and redirects

In a recent project we did we had the need to integrate a classic ASP members site with DotNetNuke. The client had invested a lot of time and money into building an ASP based system to track their membership. They had a members only site that integrated with this membership application. When we redesigned their public web site it was not in the budget to redo the members only site or integration to the membership application. We needed a work around.

They had a complicated log in that checked if they had changed their password from its ordinal, validated that they had paid their dues, and determined what chapter they belonged to. Based on the login it displayed only their chapter information. We needed to integrate aspects of the membership application along with DNN pages that just contained documents for their reference.

We decided on iframes for integrating the membership application. They displayed the login, chapter rosters, profile information, membership search, etc. It worked well and even passed the session variables when navigating to DNN pages and back to the iframe pages.

The one issue we ran into was on the login page. Once the login was validated it needed to redirect the user the main page of the members site. If you did a standard response.redirect in the ASP code it brought the page in the iframe instead of loading the page as itself. That was not going to work. Second we tried JavaScript. While this worked great, it opened a new window on top of the current page. This was very confusing for many of the users. They kept calling saying nothing happened and it just says Login.

Code Example:

strLocation = "full URL here"
openlink(strLocation)
function openlink(link)
%>
<SCRIPT language='JavaScript'>window.open(' <%=link%> ');</SCRIPT>
<%
end function

We knew we needed a solution that replaced the iframe page with the correct page. After many tries the answer was finally found. This code breaks you out of the iframe.

Code Example:

strLocation = "full URL here"
openlink(strLocation)
function openlink(link)
<SCRIPT language='JavaScript'>parent.location.href ='<%=link%> ';</SCRIPT>
<%
end function

You can leave a response, or trackback from your own site.

Leave a Reply

You must be logged in to post a comment.