Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Position of Controls

Status
Not open for further replies.

Auguy

Programmer
May 1, 2004
1,206
US
I'm new to Visual Studio 2008 ASP.Net and I apologize if some of this is really basic stuff I should know. To get started I'm just creating a simple web page to display some data from SQL in a GridView. I've worked with Windows forms for a while now and getting and displaying the data isn't the problem. The problem I'm having is the positioning of the controls like grids, buttons, etc. I feel like I'm missing something very basic but I can't seem to move any controls from the left side of the page. I've seen some references to using tables or panels to do the positioning. What is the best method of positioning controls, and how does this relate to the "Div" control? What function does the "Div" control serve? Any suggestions or recommendations will be greatly appreciated.

Auguy
Sylvania/Toledo Ohio
 
Coming from a windows app programming background and moving to web development can be very frustrating, especially when it comes to page layout and positioning. See this thread: thread855-1662759.
The old way of laying out a page was to use tables, it will still work, but tables are really for tabular type of displays, for example if you are just spitting out rows from a table. CSS is what you need to learn to use for positioning. There are many examples out there and great sites like and many others.
As for your questions, CSS is the preferred method for positioning and Divs will play quite a big role in that. A <div> will simply display whatever you put between the beginning and ending tags( It is a block element meaning it will display the next piece of HTML underneath it instead of next to it as a <span> would do, which is an in-line element.
I would say to go to some sites, view some examples and post questions here. You will learn as you go along. There are also many good book on CSS as well.
 
Thank you for information. Is there a way to position the controls without tables or CSS? I can't seem to move anything off the left side of the page.

Auguy
Sylvania/Toledo Ohio
 
Not sure what you mean by that. You most likely won't see the effects of the CSS that you apply to your page until you actually run it. You might see some in the IDE, but I wouldn't rely on that.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top