473,489 Members | 2,490 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Obtaining a ASP.NET Control's Location within the code behind class

Hello,

I am bringing up an iFrame with a calendar control in it in
coordination with a text box that holds a date field. In my code
behind class I add a method call to the text box's OnFocus event that
calls the javascript method that shows and positions the iFrame
(arguments are the text control, and the desired x and y coordinates of
the iFrame). Right now I use hardcoded fixed values for the calendar
location - it was expedient and it worked - but I would prefer to
dynamically locate the iFrame based on the location of the text box
that holds the date.

I could do this in my current scenario if I could obtain the x and y
coordinate of the text box within the code behind class (the page is
Flow Layout, not Grid Layout). I have not been able to figure out how
to obtain these coordinates.

Does anyone know a way of obtaining the x and y coordinates of a
ASP.NET text box from the code behind class?
Thanks,
Biff Gaut
Gaithersburg, MD

Nov 19 '05 #1
3 3040
"Biff" <bi*******@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hello,

I am bringing up an iFrame with a calendar control in it in
coordination with a text box that holds a date field. In my code
behind class I add a method call to the text box's OnFocus event that
calls the javascript method that shows and positions the iFrame
(arguments are the text control, and the desired x and y coordinates of
the iFrame). Right now I use hardcoded fixed values for the calendar
location - it was expedient and it worked - but I would prefer to
dynamically locate the iFrame based on the location of the text box
that holds the date.

I could do this in my current scenario if I could obtain the x and y
coordinate of the text box within the code behind class (the page is
Flow Layout, not Grid Layout). I have not been able to figure out how
to obtain these coordinates.

Does anyone know a way of obtaining the x and y coordinates of a
ASP.NET text box from the code behind class?


Server-side controls do not have x and y coordinates.

John Saunders
Nov 19 '05 #2
Biff,

You should pass the coordinates from client to server. The most common way
of passing information that way is using hidden <input> elements.

Eliyahu

"Biff" <bi*******@hotmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hello,

I am bringing up an iFrame with a calendar control in it in
coordination with a text box that holds a date field. In my code
behind class I add a method call to the text box's OnFocus event that
calls the javascript method that shows and positions the iFrame
(arguments are the text control, and the desired x and y coordinates of
the iFrame). Right now I use hardcoded fixed values for the calendar
location - it was expedient and it worked - but I would prefer to
dynamically locate the iFrame based on the location of the text box
that holds the date.

I could do this in my current scenario if I could obtain the x and y
coordinate of the text box within the code behind class (the page is
Flow Layout, not Grid Layout). I have not been able to figure out how
to obtain these coordinates.

Does anyone know a way of obtaining the x and y coordinates of a
ASP.NET text box from the code behind class?
Thanks,
Biff Gaut
Gaithersburg, MD

Nov 19 '05 #3
That's an interesting concept, I'll look into that.

Thanks,
Biff

Nov 19 '05 #4

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

Similar topics

13
2053
by: Will Pittenger | last post by:
I have a Control derived class. When the parent of the control changes the control's Location property, the stack overflows. I have not found a way to find out what was on the stack when it does...
2
13716
by: adiel | last post by:
Hello, I am trying to access the properties and methods from a user control within the code-behind file for a webform but I am receiving the message: Name 'MenuBar1' is not declared It does...
1
11020
by: Earl Teigrob | last post by:
I am creating an web control within a class and instance the class within my code behind and use its methods to dynamically generate page contents. The problem is that I need to be able to capture...
6
11264
by: martin | last post by:
Hi, I am a web page and a web user control. My web user control is placed in my web page using the following directive <%@ Register TagPrefix="uc1" TagName="Header"...
2
3602
by: John Lau | last post by:
Hi, Is there documentation that talks about the page lifecycle, the lifecycle of controls on the page, and the rendering of inline code, in a single document? Thanks, John
20
5593
by: Guadala Harry | last post by:
In an ASCX, I have a Literal control into which I inject a at runtime. litInjectedContent.Text = dataClass.GetHTMLSnippetFromDB(someID); This works great as long as the contains just...
0
2436
by: Matthew | last post by:
All, I have searched google and the newsgroups but can't find anything the same as what I am experiencing (though I may have missed something). I have controls (textboxes) within UserControls...
0
1888
by: Brian Henry | last post by:
Ok I've never implemented a snap location before so I dont really know what im doing wrong here... anyways, I am making a custom slider control that takes dates as its values instead of integers......
2
4803
by: rn5a | last post by:
Assume that a user control (MyUC.ascx) encapsulates 2 TextBoxes with the IDs 'txt1' & 'txt2' respectively. To use this user control in an ASPX page, the following Register directive will be...
0
6967
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
7181
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...
1
6847
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...
0
5445
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,...
0
4565
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...
0
3071
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1383
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 ...
1
618
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
272
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...

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.