Solved

Changing Textbox position on each display of webpage

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now