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

Get and Set Location of Controls in Page

JJ
Hi,

I am buidling some controls dynamically in the .cs file, context menu. I am
wondering if there is any chance I could obtain the location of any controls
and set the location of another control to that location. i.e. just setting
and getting the location.

Concern:
1.When is the best time to get the location? After PageLoad?
CreateChildControls?
2.I am using Javascript to obtain the location by control.style.top etc but
it returns 0 value? Y is it so?
3.Do controls such as table cells within table row within table has
position? If there is, is it relative or absolute location.

Thks
Cheers
Nov 19 '05 #1
1 2298
unless the controls have explicit absolute style postions (ie grid mode),
there is no time on the server code to do this.

in client script you can only get the position after render is done. in
client script you don't use the style to get the postion because it what was
set in html and is often empty. also the postion will be relative to its
parent position. see:

http://msdn.microsoft.com/library/default.asp
-- bruce (sqlwork.com)

"JJ" <JJ@discussions.microsoft.com> wrote in message
news:E0**********************************@microsof t.com...
Hi,

I am buidling some controls dynamically in the .cs file, context menu. I
am
wondering if there is any chance I could obtain the location of any
controls
and set the location of another control to that location. i.e. just
setting
and getting the location.

Concern:
1.When is the best time to get the location? After PageLoad?
CreateChildControls?
2.I am using Javascript to obtain the location by control.style.top etc
but
it returns 0 value? Y is it so?
3.Do controls such as table cells within table row within table has
position? If there is, is it relative or absolute location.

Thks
Cheers

Nov 19 '05 #2

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

Similar topics

10
by: Scott | last post by:
I'm new to ASP, but I've been programming in VB for several years, and I'm having a few issues with this ASP enhancement I'm working on. I've found ASP to be a lot different than what I'm use to...
2
by: Kiki | last post by:
Add user controls to programmatically specified location I have some data about a control I'm calling from a page. This control will be load n-th times on the page but only one option will be...
13
by: Marc | last post by:
The first part of the below writes the name and location of all buttons on a from to a text file. The second part reads that information back in and recreates the buttons. My problem is reading...
5
by: FAQ server | last post by:
----------------------------------------------------------------------- FAQ Topic - How do I change the text in the url/location bar?...
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: 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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.