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 %> Code (markup): I was wondering if this was changeable to detect the height of the file of the iframe src.
ASP runs on the server side, whereas page-height is a client-side attribute. The suitable place to detect Pageheight will be JavaScript which runs on the client side. You can set values in Javascript and use them in ASP: <script type='text/javascript'> <!-- document.cookie = "width=" + screen.width + ";"; document.cookie = "height=" + screen.height + ";"; //--> </script> Hope it helps. Kuldeep
Yeah that sounds interesting. Is there more to that? So the script above sets up cookies of width and height, right? And what asp script will retrieve it? Is there any tutorials on this? Thanks in advance.
In ASP you can easily read the cookie values <% width=Request.Cookies("width") height=Request.Cookies("height") %> You can see a brief tutorial on asp cookies at w3schools
Of course it will not work. If the user has turned off the cookies in the his/her browser settings you will not be able to create them (cookies).
OK. The width and height shows 1280 X 768. Is that in pixels? How will the process work? How can I manipulate so that the height of the iframe will vary according to the height of the content?
I am not sure what is your question actually but even if i understood wrong that the offered suggestion with the cookies is far away from any possible solution. You need to find the height of the CONTENT that you want to place inside iframe object which you want to set up that hight of the iframe is exactly the same as the height of the content. Therefore cookies has nothing to do with that. Correct me if i am wrong.
This is almost impossible to be sure that it is accurate as it depends on browsers etc. I also suspect that if the content is larger than one screen then it will just give you the size of that screen. Ben Shaffer
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?
I am not positive about the content. but, if you take the content from the testread.txt and it's probably text then you should probably count the lines and according that result set up the iframe height attribute.