954,574 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to Find the Position of a Textbox in a Page in Asp.net C#

Good Day All

I have a Dynaically created a Textbox and i have a Dynamically created DIV. So what i want to do is to Find the Position of the Textbox and and Dynamically when this textbox is created , please a Div just next to this textbox. So my plan was to find the position of the textbox and next to it using the position of the textbox and calculate the position of a Div.

Thanks

vuyiswamb
Posting Whiz
312 posts since Mar 2007
Reputation Points: 31
Solved Threads: 14
 

Wouldn't this be more easily done using javascript if you just need to display the div? Does your text box or div have server-side code attached to it which makes client side inappropriate?

hericles
Practically a Posting Shark
823 posts since Nov 2007
Reputation Points: 136
Solved Threads: 167
 

are generating dynamic textbox using javascript or from code behind...?

dnanetwork
Practically a Master Poster
Banned
633 posts since May 2008
Reputation Points: 28
Solved Threads: 106
 

i do it from code Behind

vuyiswamb
Posting Whiz
312 posts since Mar 2007
Reputation Points: 31
Solved Threads: 14
 

Why not use placeholders?

Tellalca
Posting Whiz in Training
209 posts since Mar 2010
Reputation Points: 29
Solved Threads: 24
 

I'd be tempted to do this client side in javascript. If need be you can call a function at the bottom of the page (to ensure everything has finished loading) and alter the position of the div if necessary.

Of course, you could make this work (probably, I haven't tried it) through good use of CSS and applying the right class to the div and text box when you create them

hericles
Practically a Posting Shark
823 posts since Nov 2007
Reputation Points: 136
Solved Threads: 167
 

hi guys i used another way. so for now its fine.

vuyiswamb
Posting Whiz
312 posts since Mar 2007
Reputation Points: 31
Solved Threads: 14
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You