Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / October 2005

Tip: Looking for answers? Try searching our database.

height

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Calvin X - 26 Oct 2005 21:25 GMT
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
Kevin Spencer - 26 Oct 2005 21:37 GMT
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.

Signature

HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
A watched clock never boils.

> 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
Curt_C [MVP] - 26 Oct 2005 21:41 GMT
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.

Signature

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

> 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
Calvin X - 26 Oct 2005 21:58 GMT
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.

> 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....
[quoted text clipped - 7 lines]
>>
>> Calvin X
Kevin Spencer - 26 Oct 2005 22:11 GMT
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%.

Signature

HTH,

Kevin Spencer
Microsoft MVP
.Net Developer
A watched clock never boils.

>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
[quoted text clipped - 13 lines]
>>>
>>> Calvin X
Peter Rilling - 26 Oct 2005 22:11 GMT
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.

>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
[quoted text clipped - 13 lines]
>>>
>>> Calvin X
sp3d2orbit - 26 Oct 2005 22:23 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.