Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    Regular Coder
    Join Date
    Mar 2005
    Posts
    735
    Thanks
    4
    Thanked 1 Time in 1 Post

    can asp detect page height?

    Can asp detect the page height?
    because I want to resize the iframe where the page is nested in.

  • #2
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    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.
    OracleGuy

  • #3
    Regular Coder
    Join Date
    Mar 2005
    Posts
    735
    Thanks
    4
    Thanked 1 Time in 1 Post
    would you know how that works?

  • #4
    Regular Coder
    Join Date
    Mar 2005
    Posts
    735
    Thanks
    4
    Thanked 1 Time in 1 Post
    I found this from
    http://www.w3schools.com/asp/showasp...emo_attributes
    Code:
    <%
    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.

  • #5
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    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

  • #6
    Regular Coder
    Join Date
    Mar 2005
    Posts
    735
    Thanks
    4
    Thanked 1 Time in 1 Post
    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?

  • #7
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •