Solved

Changing Textbox position on each display of webpage

Posted on 2004-08-20
4
1,814 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 500 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This article discusses the ASP.NET AJAX ModalPopupExtender control. In this article we will show how to use the ModalPopupExtender control, how to display/show/call the ASP.NET AJAX ModalPopupExtender control from javascript, how to show/display/cal…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

726 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