height

  • Thread starter Thread starter Calvin X
  • Start date Start date
C

Calvin X

hi all,

I am trying to get the height of my page or even the exact location of a
control. How do I do these things because I cant seem to get it.

Calvin X
 
An HTML document does not have a height. What exactly do you want to do with
it? As for the exact location of a control, you can set and get this via
CSS.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.
 
This is all clientside info... you'll have to use some javascript to grab
this and post it back to the server to use it....
May I ask why though? perhaps there is a better way to get to your end goal.
 
I have a webcontrol that will not resize to the height of the page. I have
set the table it resides in to 100% height but it still doesnt work. I have
exposed a property that allows me to set the height but I need to get a
value from the page to pass to the control. there may very well be an
easier way to do this though...I just haevn't found it.
 
Set the height of the WebControl to 100% also. It will resize to the size of
the container it is in. So, if it's in a table, you need to set BOTH to
100%.

--
HTH,

Kevin Spencer
Microsoft MVP
..Net Developer
A watched clock never boils.
 
You cannot pass that information to your control (well, easily). I would
suggest playing around with <div> and <table> tag to get it to resize. Make
sure your tables are not in some other container. Remember, 100% does not
mean "of the page", it refers to its parent container.
 
Don't you hate it when people answer a question with a question. Here's
some code to help you out. You decide if it's what you want to do.

<html>
<head>
<script>

function ShowCoordinates()
{
var oDiv = document.getElementById("test");

alert(oDiv.offsetHeight);
alert(oDiv.offsetWidth);
alert(oDiv.offsetTop);
alert(oDiv.offsetLeft);
}
</script>
</head>
<body onload="ShowCoordinates()">
test
<div id="test">
Some Text
</div>
</body>
</html>

Best of luck!

Matt Furnari
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top