Changing Textbox position on each display of webpage

I have 15 controls on my webpage (textboxes, buttons, and dropdownlist).  Everytime the wepbage is displayed I want the contols to be displayed in a different position on the form.  How do I dinamically position the controls on the webpage on each display of the webpage.  I know I can use the style feature, but I do not know how to change the position from the code behind to the html.
Who is Participating?
DotNetLover_BaanConnect With a Mentor Commented:
Hi there,
just change the style attribute in your code behind... I have inside a button click...

        TextBox1.Attributes.Add("Style", "LEFT: 74px; TOP: 27px")

Theres several ways of doing what youre trying to do - post up some of the HTML code from the .aspx page so we can see the most approriate way for you.
Or to be more specific:

Random rnd = new Random();

Best, Nauman
LucreeAuthor Commented:
Your Actual Code did not work for me, but it gave me what I needed to know. This actually worked for me. Now I should be able to get it to do what I really want.

TextBox1.Attributes.Add("Style", "Z-INDEX: 106; LEFT: " & Me.TextBoxleft.Text & "px; POSITION: absolute; TOP: " & Me.TextBoxtop.Text & "px")

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.