473,729 Members | 2,309 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Getting Top Left Poition of the control????

Hi
I am trying to write a code snippet that would display a '?' sign on the top
left of a control.
I do not want to hard code the positioning of the DIV which will contain
that '?'.

Is it possible to somehow know the top, left position of the content
rendered by a User Control in a asp page.

For eg, assume the figure below as a web page and A and B as user controls
contained in that web page.
I want to write code that would display a '?' on the position X. without
hardcoding the top, left position.

-----------------------------------------
| |
| A |
|______________ _______________ _|
| X |
| |
| |
| B |
| |
| |
|______________ _______________ _|
Thanks.

-Sami
Apr 13 '07 #1
6 2030
You should make a server control that will be a placeholder for the sign and
then just set it's value or visibility. The control could be a label, a
<span>, or something else. Make an html layout inside the div in such a way
that the placeholder will be in the required position.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"Samuel Rhodes" <sa********@4D. orgwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
Hi
I am trying to write a code snippet that would display a '?' sign on the
top
left of a control.
I do not want to hard code the positioning of the DIV which will contain
that '?'.

Is it possible to somehow know the top, left position of the content
rendered by a User Control in a asp page.

For eg, assume the figure below as a web page and A and B as user
controls
contained in that web page.
I want to write code that would display a '?' on the position X. without
hardcoding the top, left position.

-----------------------------------------
| |
| A |
|______________ _______________ _|
| X |
| |
| |
| B |
| |
| |
|______________ _______________ _|
Thanks.

-Sami


Apr 13 '07 #2
That is what I do not want to do.....

I do want to put '?' in the user control (UC1), however, I want UC1 to be
intelligent enough to determine the top, left of its parent user control
(PUC) and display its content to that particular position, instead of me
having to force it there by html layouting.

"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgwro te in
message news:u4******** ******@TK2MSFTN GP03.phx.gbl...
You should make a server control that will be a placeholder for the sign
and
then just set it's value or visibility. The control could be a label, a
<span>, or something else. Make an html layout inside the div in such a
way
that the placeholder will be in the required position.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"Samuel Rhodes" <sa********@4D. orgwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
>Hi
I am trying to write a code snippet that would display a '?' sign on the
top
>left of a control.
I do not want to hard code the positioning of the DIV which will contain
that '?'.

Is it possible to somehow know the top, left position of the content
rendered by a User Control in a asp page.

For eg, assume the figure below as a web page and A and B as user
controls
>contained in that web page.
I want to write code that would display a '?' on the position X. without
hardcoding the top, left position.

-----------------------------------------
| |
| A |
|_____________ _______________ __|
| X |
| |
| |
| B |
| |
| |
|_____________ _______________ __|
Thanks.

-Sami



Apr 13 '07 #3
Looks like you just need to style UC1 with position:absolu te;top:0;left:0 .
This should place UC1 in the top left corner of its parent.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"Samuel Rhodes" <sa********@4D. orgwrote in message
news:eD******** *****@TK2MSFTNG P04.phx.gbl...
That is what I do not want to do.....

I do want to put '?' in the user control (UC1), however, I want UC1 to be
intelligent enough to determine the top, left of its parent user control
(PUC) and display its content to that particular position, instead of me
having to force it there by html layouting.

"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgwro te in
message news:u4******** ******@TK2MSFTN GP03.phx.gbl...
You should make a server control that will be a placeholder for the sign
and
then just set it's value or visibility. The control could be a label, a
<span>, or something else. Make an html layout inside the div in such a
way
that the placeholder will be in the required position.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"Samuel Rhodes" <sa********@4D. orgwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
Hi
I am trying to write a code snippet that would display a '?' sign on
the
top
left of a control.
I do not want to hard code the positioning of the DIV which will
contain
that '?'.

Is it possible to somehow know the top, left position of the content
rendered by a User Control in a asp page.

For eg, assume the figure below as a web page and A and B as user
controls
contained in that web page.
I want to write code that would display a '?' on the position X.
without
hardcoding the top, left position.

-----------------------------------------
| |
| A |
|______________ _______________ _|
| X |
| |
| |
| B |
| |
| |
|______________ _______________ _|
Thanks.

-Sami



Apr 13 '07 #4
On Apr 13, 4:27 pm, "Samuel Rhodes" <sam.rho...@4D. orgwrote:
Hi
I am trying to write a code snippet that would display a '?' sign on the top
left of a control.
I do not want to hard code the positioning of the DIV which will contain
that '?'.

Is it possible to somehow know the top, left position of the content
rendered by a User Control in a asp page.

For eg, assume the figure below as a web page and A and B as user controls
contained in that web page.
I want to write code that would display a '?' on the position X. without
hardcoding the top, left position.

-----------------------------------------
| |
| A |
|______________ _______________ _|
| X |
| |
| |
| B |
| |
| |
|______________ _______________ _|
Thanks.

-Sami
wewewewewewewew ewewew

Apr 13 '07 #5
Noooo :)

if i use this "position:absol ute;top:0;left: 0". it will calculate the top
and left according to page, not according to user control in the page. Is
there a way to calculate the top and left of the content area rendered by
the user control, programmaticall y..

Let me give some more background info. All the user controls derive from a
base user control.. I want to provide help feature in all the user controls.
So I want to write another user control (UCHelp) which I will put in the
base UC (making it composite). I want to UCHelp to manage the positioning of
the #?' icon by itself. i.e. it should position the '?' icon at top left of
all the derived user controls. For that I need to calculate the point on the
screen where derived user control starts on the page in terms of top, left.

I DO NOT want to hardcode the top, left as user controls are used at various
places in page. I am looking for a way to do it dynamically with asp.net
code.

The solution that I already have is to read the top, left property of the
top most container div in a user control by using javascript and positioning
my '?' icon accordingly. I am looking for an asp.net way of solving this
problem..
"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgwro te in
message news:uu******** ******@TK2MSFTN GP05.phx.gbl...
Looks like you just need to style UC1 with position:absolu te;top:0;left:0 .
This should place UC1 in the top left corner of its parent.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"Samuel Rhodes" <sa********@4D. orgwrote in message
news:eD******** *****@TK2MSFTNG P04.phx.gbl...
>That is what I do not want to do.....

I do want to put '?' in the user control (UC1), however, I want UC1 to be
intelligent enough to determine the top, left of its parent user control
(PUC) and display its content to that particular position, instead of me
having to force it there by html layouting.

"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgwro te in
message news:u4******** ******@TK2MSFTN GP03.phx.gbl...
You should make a server control that will be a placeholder for the
sign
and
then just set it's value or visibility. The control could be a label, a
<span>, or something else. Make an html layout inside the div in such a
way
that the placeholder will be in the required position.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"Samuel Rhodes" <sa********@4D. orgwrote in message
news:%2******** ********@TK2MSF TNGP03.phx.gbl. ..
Hi
I am trying to write a code snippet that would display a '?' sign on
the
top
left of a control.
I do not want to hard code the positioning of the DIV which will
contain
>that '?'.

Is it possible to somehow know the top, left position of the content
rendered by a User Control in a asp page.

For eg, assume the figure below as a web page and A and B as user
controls
contained in that web page.
I want to write code that would display a '?' on the position X.
without
>hardcoding the top, left position.

-----------------------------------------
| |
| A |
|_____________ _______________ __|
| X |
| |
| |
| B |
| |
| |
|_____________ _______________ __|
Thanks.

-Sami




Apr 13 '07 #6
If you already have a javascript solution, you don't need to look for
anything else. Javascript is pretty an asp.net way, the more of it (the
javascript) the better.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"Samuel Rhodes" <sa********@4D. orgwrote in message
news:OS******** ******@TK2MSFTN GP04.phx.gbl...
Noooo :)

if i use this "position:absol ute;top:0;left: 0". it will calculate the top
and left according to page, not according to user control in the page. Is
there a way to calculate the top and left of the content area rendered by
the user control, programmaticall y..

Let me give some more background info. All the user controls derive from a
base user control.. I want to provide help feature in all the user
controls. So I want to write another user control (UCHelp) which I will
put in the base UC (making it composite). I want to UCHelp to manage the
positioning of the #?' icon by itself. i.e. it should position the '?'
icon at top left of all the derived user controls. For that I need to
calculate the point on the screen where derived user control starts on the
page in terms of top, left.

I DO NOT want to hardcode the top, left as user controls are used at
various places in page. I am looking for a way to do it dynamically with
asp.net code.

The solution that I already have is to read the top, left property of the
top most container div in a user control by using javascript and
positioning my '?' icon accordingly. I am looking for an asp.net way of
solving this problem..
"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgwro te in
message news:uu******** ******@TK2MSFTN GP05.phx.gbl...
>Looks like you just need to style UC1 with
position:absol ute;top:0;left: 0.
This should place UC1 in the top left corner of its parent.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"Samuel Rhodes" <sa********@4D. orgwrote in message
news:eD******* ******@TK2MSFTN GP04.phx.gbl...
>>That is what I do not want to do.....

I do want to put '?' in the user control (UC1), however, I want UC1 to
be
intelligent enough to determine the top, left of its parent user control
(PUC) and display its content to that particular position, instead of me
having to force it there by html layouting.

"Eliyahu Goldin" <RE************ **************@ mMvVpPsS.orgwro te in
message news:u4******** ******@TK2MSFTN GP03.phx.gbl...
You should make a server control that will be a placeholder for the
sign
and
then just set it's value or visibility. The control could be a label,
a
<span>, or something else. Make an html layout inside the div in such
a
way
that the placeholder will be in the required position.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
"Samuel Rhodes" <sa********@4D. orgwrote in message
news:%2******* *********@TK2MS FTNGP03.phx.gbl ...
Hi
I am trying to write a code snippet that would display a '?' sign on
the
>top
left of a control.
I do not want to hard code the positioning of the DIV which will
contain
>>that '?'.

Is it possible to somehow know the top, left position of the content
rendered by a User Control in a asp page.

For eg, assume the figure below as a web page and A and B as user
controls
contained in that web page.
I want to write code that would display a '?' on the position X.
without
>>hardcoding the top, left position.

-----------------------------------------
| |
| A |
|____________ _______________ ___|
| X |
| |
| |
| B |
| |
| |
|____________ _______________ ___|
Thanks.

-Sami




Apr 15 '07 #7

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

Similar topics

1
5746
by: Mohan | last post by:
Hi All, I am using web browser control in a VB 6.0 client server application to print reports. I am writing the report into a HTML file and displays the report to the user using the code, webbrowsercontrol.navigate2 "path of the html file" method. When the user clicks command button on the VB form to print the report I am using the following code, webbrowsercontrol.ExecWB
3
4325
by: Mr. x | last post by:
Hello, I have simple table <table id = "mytable" ....> .... </table> I want to get the left position of the table. Everything I did getting wrong :
6
2164
by: CoreyMas | last post by:
Hello All, Here is what I would like to do I am creating a game program that displays a map (preferably in hexes but that is another matter) and whenever the user is over the "map" I want to know the x,y coords (in pixels) of where he is pointing to. Here is what I have done
2
2842
by: Alex | last post by:
Hi all, I'm writing a small web application which searches a database based on a date field, and populates a datagrid control with the results. The datagrid control has selection buttons added to it to view additional details about the selected result (a second database query is triggered). I want this second query to pop up in a new window, the way it would if I used "window.open" in javascript. I've added a function in the
2
2718
by: Steve Bottoms | last post by:
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.value) 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.height), but that...
7
5486
by: charliewest | last post by:
Hello - I'm using a Repeater control to render information in a very customized grid-like table. The Repeater control is binded to a DataSet with several records of information. Within the Repeater control, I've placed DropDownLists and CheckBoxes. When the user has updated the information, he/he clicks the submit button which is outside the scope of the Repeater control.
1
2691
by: Gunjan Garg | last post by:
Hello All, I am working to create a generic datagrid which accepts a datasource(ListData - This is our own datatype) and depending on the calling program customizes itself for sorting, paginantion or accepting the add and remove item events. What i am observing is that none of the vents are happening... (Sort, page, or item). I am sure I am missing something basic here... Need help... Thanks much
3
1449
by: Bob | last post by:
My control pops a menu (below, not directly under, the pointer) OnMouseDown, and, probably because of the loss of focus, OnDoubleClick doesn't fire any more. Is there a way to get doubleclick back without some ugly workaround? TIA, Bob
7
4440
vikas251074
by: vikas251074 | last post by:
I am getting error above in following code since few days giving tension day and night. How can I solve this? I am facing since Oct.25. in line no. 362 After doing a lot of homework, I am surrendered to you. <%@ Language=VBScript%> <%Option Explicit%>
0
8917
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
8761
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,...
1
9200
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
9142
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8148
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
6022
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4525
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
3238
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
2
2680
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.