?
Solved

Changing Textbox position on each display of webpage

Posted on 2004-08-20
4
Medium Priority
?
1,822 Views
Last Modified: 2008-05-16
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.
0
Comment
Question by:Lucree
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 

Expert Comment

by:mafrosis
ID: 11851773
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.
0
 
LVL 18

Accepted Solution

by:
DotNetLover_Baan earned 1500 total points
ID: 11851803
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")

-Baan
0
 
LVL 25

Expert Comment

by:nauman_ahmed
ID: 11852146
Or to be more specific:

Random rnd = new Random();
TextBox1.Attributes.Add("Style",rnd.Next(10,100).ToString()+"px;Top:"+rnd.Next(15,90).ToString()+"px;");

Best, Nauman
0
 

Author Comment

by:Lucree
ID: 11853204
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")


Thanks,
Dean
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
Today is the age of broadband.  More and more people are going this route determined to experience the web and it’s multitude of services as quickly and painlessly as possible. Coupled with the move to broadband, people are experiencing the web via …
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question