473,385 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

height

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
Nov 19 '05 #1
6 1043
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.

"Calvin X" <spam fr***********************@rotsnail.com> wrote in message
news:eS**************@TK2MSFTNGP15.phx.gbl...
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

Nov 19 '05 #2
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.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Calvin X" wrote:
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

Nov 19 '05 #3
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.
"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:1C**********************************@microsof t.com...
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.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Calvin X" wrote:
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

Nov 19 '05 #4
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.

"Calvin X" <spam fr***********************@rotsnail.com> wrote in message
news:uQ*************@TK2MSFTNGP15.phx.gbl...
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.
"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:1C**********************************@microsof t.com...
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.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Calvin X" wrote:
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


Nov 19 '05 #5
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.

"Calvin X" <spam fr***********************@rotsnail.com> wrote in message
news:uQ*************@TK2MSFTNGP15.phx.gbl...
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.
"Curt_C [MVP]" <software_at_darkfalz.com> wrote in message
news:1C**********************************@microsof t.com...
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.

--
Curt Christianson
site: http://www.darkfalz.com
blog: http://blog.darkfalz.com

"Calvin X" wrote:
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


Nov 19 '05 #6
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

Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Paul | last post by:
Hi, I'm wondering if someone out there can help me overcome this quandary. I need to be able to calculate the height of the current page. I need to calculate the height of the page in pixels after...
10
by: John | last post by:
I have a table with two rows. On the first row is a text box and in the second row is an image. I have set the table cellpadding to 0 and cellspacing to 0. The table is leaving extra spaces in the...
12
by: Stanimir Stamenkov | last post by:
Here are two cases regarding inline-level elements' line-height, padding and background, which I doesn't understand: <div style="background: black; color: white; line-height: 1.5">...
5
by: Secret Guy | last post by:
Because of my experience posting various places over the last couple of weeks: I'm expecting to be greated with hostility for asking about concepts instead of "practical" things, since that has...
5
by: Kevin Myers | last post by:
How can one obtain obtain the height of a MS Access 2K form? There is a width property, but I don't see a corresponding height property. I need to obtain the height of the form so that I can...
1
by: polocar | last post by:
Ciao a tutti, leggendo qua e lą per il forum ho scoperto che non sono l'unico ad avere questo problema. Se si inserisce un controllo ComboBox in un form di C#, non č possibile impostare la sua...
1
by: Mike Collins | last post by:
I am trying to create some pages and have them take 100% of the window, but I cannot get 100% to work. If I set the height of my div, the page displays a scroll bar and it looks like I set the...
1
by: mascouta | last post by:
I have a lot of problems with IE browser, one of them is described in this topic. in my website i have div Calculator with background image. it displayed perfectly with Firefox browser however in IE...
1
by: pravinnweb | last post by:
can anyone tell me how to set auto height to outer div that is in green box id "gray-background" it should increase relatively to inner div "smbox" here is the css and html code it should work in...
4
by: AAaron123 | last post by:
<body runat="server" id="MainBody"> <form id="form1" runat="server" style="background-color:green; width: 100%; height: 100%"> <br /> Table1" runat="server" Style="background-color:Yellow;...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.