473,757 Members | 9,463 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem getting HEIGHT property of a dynamic table!

Hi, all! Using VB as code-behind in asp.net page...

I have a TABLE control which I'm building dynamically. After the table is
built, I'm trying to retrieve the HEIGHT property of that table
(table.height.v alue) to be able to dynamically position the next elements on
the form. However, this control property is coming back as -0- every time.
I also try to get the table height with Javascript after-the-fact
(table.style.he ight), but that returns a blank value.

How can I get the height of the TABLE control AFTER building it, so I know
where to place the next few elements in the flow??? Very frustrating for
something that should be relatively simple...

Thanks for any suggestions!
Jack
Nov 19 '05 #1
2 2720
I think table.style.hei ght is a client side property, so you cant detect it
in server side code. Its also a really bad choice for layout as its so
badly reprepsented in browesers that the use of it at best is typically
flaky.

Think about using panels and DIVs instead adn determine your positioning
relative to the top left (0) of the browser window..

< asp:Panel id="Panel1" runat="server" style="POSITION : absolute;
Left:910px; TOP:208px">
< /asp:Panel>

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"Steve Bottoms" <sp**********@h otmail.com> wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
Hi, all! Using VB as code-behind in asp.net page...

I have a TABLE control which I'm building dynamically. After the table is
built, I'm trying to retrieve the HEIGHT property of that table
(table.height.v alue) to be able to dynamically position the next elements on the form. However, this control property is coming back as -0- every time. I also try to get the table height with Javascript after-the-fact
(table.style.he ight), but that returns a blank value.

How can I get the height of the TABLE control AFTER building it, so I know
where to place the next few elements in the flow??? Very frustrating for
something that should be relatively simple...

Thanks for any suggestions!
Jack

Nov 19 '05 #2
Well, here's the thing: I'm generating a variable number of sections
(currently one row in a table) of variable length (some may be one word,
some may be 1000 words). Each of these blocks (currently generated as
multi-row tables) come one right after another. Using something like a
region with a scroll bar isn't an option. I need to be able to "look" at a
block (right now a table), get it's total on-screen height (which may be
variable: nothing is fixed height), and use that to place the next block of
text/items, which ALSO are variable. I can't use ANYTHING that's of fixed
size, because that's just plain ugly. I'm finding it a bit hard to believe
that this is so difficult.

Does the size of a Panel (never used them except to display fixed-length
text) grow based on the amount of content? Does the Panel have a height
property that can be used to determine the positioning for the next element
underneath it, or does it automatically grow, pushing later elements (Panels
& Labels) further down? Can the Panel display HTML/DHTML (the text may have
HTML; a quick test of a Panel doesn't render HTML)?

This seems like such a simple thing, I can't believe it's not available in
this day and age!! ;-)

Jack


"John Timney (ASP.NET MVP)" <ti*****@despam med.com> wrote in message
news:eG******** ******@TK2MSFTN GP10.phx.gbl...
I think table.style.hei ght is a client side property, so you cant detect it
in server side code. Its also a really bad choice for layout as its so
badly reprepsented in browesers that the use of it at best is typically
flaky.

Think about using panels and DIVs instead adn determine your positioning
relative to the top left (0) of the browser window..

< asp:Panel id="Panel1" runat="server" style="POSITION : absolute;
Left:910px; TOP:208px">
< /asp:Panel>

--
Regards

John Timney
ASP.NET MVP
Microsoft Regional Director

"Steve Bottoms" <sp**********@h otmail.com> wrote in message
news:%2******** ********@TK2MSF TNGP14.phx.gbl. ..
Hi, all! Using VB as code-behind in asp.net page...

I have a TABLE control which I'm building dynamically. After the table
is
built, I'm trying to retrieve the HEIGHT property of that table
(table.height.v alue) to be able to dynamically position the next elements

on
the form. However, this control property is coming back as -0- every

time.
I also try to get the table height with Javascript after-the-fact
(table.style.he ight), but that returns a blank value.

How can I get the height of the TABLE control AFTER building it, so I
know
where to place the next few elements in the flow??? Very frustrating for
something that should be relatively simple...

Thanks for any suggestions!
Jack


Nov 19 '05 #3

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

Similar topics

1
2220
by: Amar | last post by:
I have a web form with several fields. Depending on user selection in one combo box, i populate a text box and a check box in one line. For example if the user selects 2 years, then i show the user two lines with each line containing 1 text box and 1 check box. I have already put in 10 lines, using ,<tr> in a table, from which i display only the required number of <tr> in the code behind (setting the visible property of controls). Each...
39
19646
by: Martin Jørgensen | last post by:
Hi, I'm relatively new with C-programming and even though I've read about pointers and arrays many times, it's a topic that is a little confusing to me - at least at this moment: ---- 1) What's the difference between these 3 statements: (i) memcpy(&b, &KoefD, n); // this works somewhere in my code
2
8366
by: JMT | last post by:
Hello, I get some dynamic controls (ASP .Net) inside a table, the height property of the table is variable according the controls loaded, so I need to know the final table height, this value must be an odd number by graphic design. I put the next code at bottom of the page; <script type="text/javascript" language="JavaScript1.2">
0
3505
by: sjickells | last post by:
Hi I am having a problem using asp:TextBox's in a transparent table. I have a background image on the page and a table in the middle of the page. I have set the background colour of the table to white the used CSS to set the opacity to 90 so that you can see the background image through the table. The problem I am having is with the textboxes in the transparent
1
1444
by: kchaitanya | last post by:
I have created a master page. When I am adding this master page to .aspx files which are in the root directory, it is working fine. When , I am adding master page to .aspx files which are in sub folders , I am getting some problem. Initially, images are not displayed. If I am using runat="server", they are dispalyed. But , I am not getting some text and background color at the place of those text messages. Please check in the below code....
2
2636
by: sirdavethebrave | last post by:
Hi guys - I have written a form, and a stored procedure to update the said form. It really is as simple as that. A user can go into the form, update some fields and hit the update button to update the information which is stored in a SQL database. In testing we noticed that the form was updating correctly but the update mechanism was also updating the first record of the table in the sql database every time. No error messages are on...
2
3014
by: swethak | last post by:
hi , i write the code in .htm file. It is in cgi-bin/searches/one.htm.In that i write a form submitting and validations.But validations are not worked in that .htm file. I used the same code in my local system that validations work.plz tell that whats the problem in that. Here is my code <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html...
2
3153
by: swethak | last post by:
Hi, I am getting the problem the problem with google map in Internet Explorer. This map worked fine in mozilla . When i opened the same map in Internet Explorer i am getting the error message as in alert box as " Internet Explorer cannot open the Internet site http://google.citycarrentals.com.au/viewalllocations.php . Operation aborted". It is working in Mozilla . Here i mentioned my code . I am facing this problem several...
0
9489
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9298
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10072
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8737
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5172
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3829
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3399
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2698
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.