theresadean
asked on
IFRAME resizing issues in asp.net web applications.
I have a master page that has an IFRAME, which we use for resizing. Locally, when we are using our web application within our network, the resizing works perfectly for both Firefox and IE. However, when I access the web application from outside the network the resizing doesn't always work. Most of the time, the offsetheight for the div(container is the name) is not correct, thus I don't see all the results that I need to see in the IFRAME Here is the resizing code below.
function resizeTheFrame() {
var iframe = document.getElementById('i
var containerHeight = document.getElementById('c
var DefaultPageHeight = 400;
if (containerHeight > DefaultPageHeight) {
var heightdiff = 100;
}
else {
var heightdiff = DefaultPageHeight - containerHeight;
}
containerHeight = containerHeight + heightdiff;
var counter = parent.top.window.location
var urlStr = parent.top.window.location
iframe.src = urlStr + "resizer.htm?height=" + containerHeight;
}
Parent page and child page are in in same domain
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
can you supply a link to the complete page?
ASKER
I won't be able to because it contains sensitive data.
I should have mentioned this earlier, but there's another parent page(default.aspx page), which the master page of the web application is the child, and the web app is in the master page. The master page and the its web application are both inside the default.aspx page.
I should have mentioned this earlier, but there's another parent page(default.aspx page), which the master page of the web application is the child, and the web app is in the master page. The master page and the its web application are both inside the default.aspx page.
I am sure there is a solution but without some code to test it is impossible to figure that out. You should store the html-Source from the browser and set up a little test scenario without sensitive data
ASKER
Attached are two files: IFRAMEERROR.bmp(where a user was attempting to use it outside our network. The gray footer box is covering the rest of the data), and IFRAMEWORKS.bmp(where the iframe works when accessing the site within our network. The gray footer box is not covering any of the data). You'll notice the user and myself are not using the same exact browser versions, but this is happening on any Firefox or IE browser we use.
also the javascript code is in a js file, which gets initialized in the page_init sub in the master page
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
Dim portalScript As New HtmlGenericControl
Dim globalScripts As New HtmlGenericControl
Dim configVariable As String = ""
Dim jsSource As String = ""
Dim otherScripts As String = ""
configVariable = System.Configuration.Confi gurationMa nager.AppS ettings("P ortalEnvir onment")
If Not configVariable Is Nothing Then
If Not configVariable = "local" Then
jsSource = ResolveUrl("~/App_Javascri pt/KIT_Res izer.js")
portalScript.TagName = "script"
portalScript.Attributes.Ad d("type", "text/javascript")
portalScript.Attributes.Ad d("languag e", "javascript")
portalScript.Attributes.Ad d("src", jsSource)
Me.Page.Header.Controls.Ad d(portalSc ript)
End If
End If
otherScripts = ResolveUrl("~/App_Javascri pt/global. js")
globalScripts.TagName = "script"
globalScripts.Attributes.A dd("type", "text/javascript")
globalScripts.Attributes.A dd("langua ge", "javascript")
globalScripts.Attributes.A dd("src", otherScripts)
Me.Page.Header.Controls.Ad d(globalSc ripts)
End Sub
IFRAMEERROR.bmp
IFRAMEWORKS.bmp
also the javascript code is in a js file, which gets initialized in the page_init sub in the master page
Protected Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
Dim portalScript As New HtmlGenericControl
Dim globalScripts As New HtmlGenericControl
Dim configVariable As String = ""
Dim jsSource As String = ""
Dim otherScripts As String = ""
configVariable = System.Configuration.Confi
If Not configVariable Is Nothing Then
If Not configVariable = "local" Then
jsSource = ResolveUrl("~/App_Javascri
portalScript.TagName = "script"
portalScript.Attributes.Ad
portalScript.Attributes.Ad
portalScript.Attributes.Ad
Me.Page.Header.Controls.Ad
End If
End If
otherScripts = ResolveUrl("~/App_Javascri
globalScripts.TagName = "script"
globalScripts.Attributes.A
globalScripts.Attributes.A
globalScripts.Attributes.A
Me.Page.Header.Controls.Ad
End Sub
IFRAMEERROR.bmp
IFRAMEWORKS.bmp
ASKER
Hey Marbleman,
Have any thoughts or ideas why this is happening based on what I've sent to you?
Have any thoughts or ideas why this is happening based on what I've sent to you?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER