Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsIFrameIFrameAdd This to the new IFrame code while you' />Add This to the new IFrame code while you're in there
Previous
 
Next
New Post
11/7/2005 7:51 PM
 

Hi:

Here's a piece of code that will force the iframe page to go to the top of the site when a link inside of an iframe page is clicked. This really helps when you scroll down an iframe page, and then click on a link within the page. Normally the page in the iframe updates but the "portal" will not return to the top of the page. This helps fix that problem.

Add this piece of javascript to the ascx page of the iframe module.

<script language="javascript" type="text/javascript">
function chi_setiframepagetotop() {
try {
if (document.body && document.body.scrollTop) document.body.scrollTop=0;
if (document.documentElement && document.documentElement.scrollTop) document.documentElement.scrollTop=0;
if (window.pageYOffset) window.pageYOffset=0; 
   }
catch(e)
{}
}
</script>
<asp:Label id="lblIFrame" Runat="server" EnableViewState=False></asp:Label>

 

Chane this in the code behind file. To add in the :

onload=chi_setiframepagetotop()

code to the frame string builder. such as:

Dim FrameText As New StringBuilder
                        FrameText.Append("<iframe onload=chi_setiframepagetotop() frameborder=""")
                        FrameText.Append(CType(Settings("border"), String))
                        FrameText.Append(""" src=""")
                        FrameText.Append(AddHTTP(src))
                        FrameText.Append(""" height=""")
                        FrameText.Append(CType(Settings("height"), String))
                        FrameText.Append(""" width=""")
                        FrameText.Append(CType(Settings("width"), String))
                        FrameText.Append(""" title=""")
                        FrameText.Append(CType(Settings("title"), String))
                        FrameText.Append(""" scrolling=""")
                        FrameText.Append(CType(Settings("scrolling"), String))
                        FrameText.Append(""">Your Browser Does Not Support Frames</iframe>")
                        lblIFrame.Text = FrameText.ToString

 

Hope this helps someone out.

 

 
New Post
11/25/2005 12:38 PM
 
This will have to be an optional inclusion. Some sites may want their page requests to stay internal (to the iframe).

Michael Flanakin | Microsoft Consulting Services
www.michaelflanakin.com
 
New Post
2/8/2006 2:36 PM
 

Is there any way to incorporate this functionality without rebuilding the core?

 

 


Dwayne J. Baldwin
 
New Post
2/8/2006 2:42 PM
 
If you get a copy of the source for this module, there is a solution and a project file. Use these to make any changes and recompile to get your mods into DNN. There is no need to recompile the DNN core for module changes.

Michael Flanakin | Microsoft Consulting Services
www.michaelflanakin.com
 
New Post
2/8/2006 3:01 PM
 

Sorry, I meant without rebuilding the dll.

I have a 3.1 installation needing this fix, but I'm not in the mood to reinstall a working version of DNN 3.1 and reinstall VS 2003, especially when I'm setup for 4.x with VS 2005.

I was just hoping for a faster alternative.


Dwayne J. Baldwin
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsIFrameIFrameAdd This to the new IFrame code while you' />Add This to the new IFrame code while you're in there


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out