How to position a textbox under an image in asp.net, c#

asp.net 2.0, C# 2008.  I have a page that contains a few images (which hold Google chart url's).
Under one of the images I wish to position a mult-iline text box that lines up directly under that image (AFTER the images and charts have been created and displayed...I will not know the exact position to put the textbox until then). Please show me the  syntax (style, etc), for the textbox, and then show me how to get the position of the image so that I can use that position to line up the textbox (in the c# code).  Thanks
eelouAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ajitha75Commented:
use this javascript code. you can call it during the onload of the page and pass the image.clientID from code behind.

            <script language='javascript'>
                  function addTextBox(imgElementId)
                  {
                        var imgElement = document.getElementById(imgElementId);
                        var txtBox = document.createElement('input');
                        var breakElement = document.createElement('br');
                        txtBox.id = 'txtData';
                        txtBox.type = 'text';
                        txtBox.value = 'Hello World';
                        imgElement.parentElement.insertBefore(txtBox, imgElement.nextSibling);
                        imgElement.parentElement.insertBefore(breakElement, imgElement.nextSibling);
                  }
            </script>
0
EspavoCommented:
Is the size of the TextBox fixed?
A simple <br /> between the Image and the TextBox will position the textbox directly below the image...
Espavo
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
eelouAuthor Commented:
What I did was to move the image that I wanted the textbox under, to the first position.  Thus the textbox lined up under it.
0
EspavoCommented:
The thing to watch-for doing it like this is that if the image is below a certain size that the textbox will position itself next to the image... (The <br /> will prevent that from happening...)
Espavo
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.