...

View Full Version : can asp detect page height?



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

oracleguy
08-08-2007, 06: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.

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

gilgalbiblewhee
08-08-2007, 06:58 PM
I found this from
http://www.w3schools.com/asp/showasp.asp?filename=demo_attributes

<%
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.

Spudhead
08-09-2007, 04:19 PM
Nope. Here's some documentation on File.Attributes:
http://www.devguru.com/technologies/vbscript/14028.asp

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 :)

gilgalbiblewhee
08-14-2007, 03: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?

Spudhead
08-14-2007, 04: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.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum