Hello,
I looked at the code you did on the IFrame. Nice work. One thing, since the user probably doesn't want to see the error about null or is nothing when trying to re-size the iframe on a site outside the domain, I edited the portion of the Resize String block in the catch to look like:
+ "catch(err){ " _
+ "var re = /null or not an object$/i;" _
+ "if (re.test(err.message)) {}" _
+ " else { window.status = err.message; }" _
+ "}}"
Also, I have been working on a module on and off myself over the years called Content Links that I have published here on the forums a few times also for various DNN versions. Well, I basically take the Links module and allow you to render a link inside a Pane as well as a new window or the entire window. In doing so, I have to pseudo-inject an IFRAME into the Pane to get it to do this and pass it the parameters, hence I was running into the same issue with height.
Looking at the posts, the 100% height, doesn't work for IFRAME by itself, BUT if the container also has a 100% height, or possibly some height defined, I know it seems to work with 100% hieght, then it seems to stretch it. It also worked for frames outside the domain.
Since I am injecting, what I did was locate the Pane I was referencing and inject the frame, with:
Private Function InjectIFrame(ByVal PaneID As String, ByRef htmIFrame As HtmlGenericControl) As Boolean
Dim ctlPane As Control
Dim bRet As Boolean = False
Dim strPane As String
Try
For Each strPane In PortalSettings.ActiveTab.Panes
If strPane.ToLower.Trim = PaneID.ToLower.Trim Then 'Make sure we are checking only valid Panes
ctlPane = DotNetNuke.UI.Skins.Skin.GetParentSkin(Me).FindControl(strPane)
If Not ctlPane Is Nothing Then
If ctlPane.ID.ToLower.Trim = PaneID.ToLower.Trim Then
'Mod Pane Style for 100% height if IFrame has 100% Height.
'Also Check For and Remove DNNEmptyPane Class Element From Pane
If TypeOf ctlPane Is HtmlControl Then
With CType(ctlPane, HtmlControl)
If .Style.Count > 0 Then
If .Style.Value.Contains("height") Then
.Style("height") = htmIFrame.Style("height")
Else : .Style.Add("height", htmIFrame.Style("height"))
End If
Else : .Style.Add("height", htmIFrame.Style("height"))
End If
If .Attributes.Count > 0 Then
Try
.Attributes("class") = .Attributes("class").Replace(" DNNEmptyPane", "")
Catch ex As Exception
End Try
End If
End With
End If
ctlPane.Controls.Add(htmIFrame)
bRet = True
End If
End If
End If
Next
Catch
End Try
Return bRet
End Function
In my links code, I was creating an IFRAME as htmIFrame, then I would pass it to this function and also pass the name of the Pane I want to inject it to, such as ContentPane or LeftPane as a string value. In here, it would check if the IFRAME has a height set, if it does, it will set the Pane to be the same height.
In my generation of the iframe, I will add an htmIFRAME.Style.Add("height", "100%") and it seems to work fine and expands to the full height of the TD for the pane.
First time I think I have gotten it to work and it has taken me a few years on an off to also figure out I needed the GetParentSkin to refrence the correct Pane, otherwise you will wind up injecting into the wrong container.
Hope this helps someone.