473,388 Members | 1,408 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,388 software developers and data experts.

How ro get the width of the DIV?

Hi,

The DIV is a htmlgenericcontrol object.
I have no idea to get its width.

Is it dctr.Style.Item(?)?
I dont know the ? item.

Your help will be appreciated.
Thank you.

Best regards,
Ocurnos

Nov 19 '05 #1
5 1325
You can only get it on client side and then transfer to the server in a
hidden input control.

Eliyahu

"Daniel" <Da****@discussions.microsoft.com> wrote in message
news:57**********************************@microsof t.com...
Hi,

The DIV is a htmlgenericcontrol object.
I have no idea to get its width.

Is it dctr.Style.Item(?)?
I dont know the ? item.

Your help will be appreciated.
Thank you.

Best regards,
Ocurnos

Nov 19 '05 #2
AF
> Is it dctr.Style.Item(?)?

myDiv.Style.Add("width", "12px");
string myWidth = myDiv.Style["width"];

?

Antonio
Nov 19 '05 #3
Not that simple.

Browsers have their own logic and priorities. They may consider your
instructions as recommendations and set another width.

Eliyahu

"AF" <nX************@nXxtg.XnetX> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Is it dctr.Style.Item(?)?


myDiv.Style.Add("width", "12px");
string myWidth = myDiv.Style["width"];

?

Antonio

Nov 19 '05 #4
"You can only get it on client side and then transfer to the server in a
hidden input control."
I dont understand what is hidden control. Can u kindly more elaborate on the
above sentence?
"Eliyahu Goldin" wrote:
Not that simple.

Browsers have their own logic and priorities. They may consider your
instructions as recommendations and set another width.

Eliyahu

"AF" <nX************@nXxtg.XnetX> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
Is it dctr.Style.Item(?)?


myDiv.Style.Add("width", "12px");
string myWidth = myDiv.Style["width"];

?

Antonio


Nov 19 '05 #5
<input type=hidden id=inhDivWidth runat=server>

This is an invisible html control. In javascript you get the width of the
panel and assign it to inhDivWidth.value. The value will get to the server
with a postback and your server code can access inhDivWidth.Value.

Eliyahu

"Daniel" <Da****@discussions.microsoft.com> wrote in message
news:23**********************************@microsof t.com...
"You can only get it on client side and then transfer to the server in a
hidden input control."
I dont understand what is hidden control. Can u kindly more elaborate on the above sentence?
"Eliyahu Goldin" wrote:
Not that simple.

Browsers have their own logic and priorities. They may consider your
instructions as recommendations and set another width.

Eliyahu

"AF" <nX************@nXxtg.XnetX> wrote in message
news:%2****************@TK2MSFTNGP14.phx.gbl...
> Is it dctr.Style.Item(?)?

myDiv.Style.Add("width", "12px");
string myWidth = myDiv.Style["width"];

?

Antonio


Nov 19 '05 #6

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

Similar topics

2
by: Alex Shi | last post by:
In php, is there a way obtain the width of a charactor of a certain font? Alex -- ================================================== Cell Phone Batteries at 30-50%+ off retail prices!...
7
by: Graham J | last post by:
Apologies for the partial post that mysteriously escaped as I was composing. I shall try again. For many years I have been happily and successfully coding tables such that the WIDTH specified...
16
by: karlman | last post by:
I am trying to create a web page that shows a calendar schedules. I am attempting to use table cells with fixed widths and different colors to display this. It seems that IE6 doesn't always...
0
by: javaguy | last post by:
I have a table I hide show/hide through a pair of divs. The show/hide part works fine in both Mozilla and MSIE. When switching between the hide and show versions the Mozilla browser keeps them in...
2
by: Stewart | last post by:
Originally posted in comp.lang.javascript: Newsgroups: comp.lang.javascript From: "Stewart" Date: 23 Aug 2005 02:50:04 -0700 Local: Tues, Aug 23 2005 10:50 am Subject: FireFox, RemoveChild,...
50
by: Shadow Lynx | last post by:
Consider this simple HTML: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 STRICT//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head>...
6
by: Hacking Bear | last post by:
Hi, I still don't quite fully understand how to handle mixing border/margin pixel width with percentage width. In the example below, I want to place side-by-side two DIV boxes inside a box....
5
by: Taras_96 | last post by:
Hi everyone, Can anyone tell me why the top paragraph block stretches across the screen (as you would expect), while the bottom div doesn't stretch across the entire screen? When I set the width...
4
by: lilOlMe | last post by:
Hi there! I'm developing a "scrollable table". At first I started using CSS. It worked pretty well until I found a bug that happens when placing this table into a tabbing control... So I...
2
by: Jukka K. Korpela | last post by:
Sub titulo "Re: DIV borders different in IE7 when in td" scripsit Ben C: This seems to be the heart of the matter, and I'm trying to get a real discussion started, by moving the discussion to...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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
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,...
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...
0
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...

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.