View Full Version : can asp detect page height?

08-08-2007, 05:37 PM
Can asp detect the page height?
because I want to resize the iframe where the page is nested in.

08-08-2007, 07:20 PM
ASP is done on the server-side so it can't detect anything about the browser on the client side. If you want to pass that information to ASP you'll have to use Javascript first.

08-08-2007, 07:32 PM
would you know how that works?

08-08-2007, 07:58 PM
I found this from

dim fs,f
set fs=Server.CreateObject("Scripting.FileSystemObject")
set f=fs.GetFile(Server.MapPath("testread.txt"))
Response.Write("The attributes of the file testread.txt are: " & f.Attributes)
set f=nothing
set fs=nothing
I was wondering if this was changeable to detect the height of the file of the iframe src.

08-09-2007, 05:19 PM
Nope. Here's some documentation on File.Attributes:

It's for seeing if a file is read-only etc. Not for checking the height of the content that any HTML in it would generate.

You need the client-side forum :)

08-14-2007, 04:25 PM
I have a page, the index.asp where right in the middle is an iframe that opens another page. I want the iframe to resize itself according to the content of the page within the iframe. Do you understand that so far?

The reason for doing this is because I have div tags of advertisements right under the iframe and I don't want put a fixed height because either, when the content of the iframe is too little the bottom advertisements will be far away at the bottom. On the other hand when I place them higher when the iframe content changes it's size and become larger in height then the div tags are going to overlap the content of the iframe.

How do I fix that problem?

08-14-2007, 05:17 PM
Yes, I understand. This is a client-side issue. Look here: http://www.quirksmode.org/viewport/compatibility.html

You CAN resize the iframe dynamically according to the height of the page it contains, but you can't do it with ASP or any server-side code. You will have to use client-side (ie: JavaScript) code, and for that you'll need the JavaScript forum.