I am using Visual Basic 2008. I am trying to create a web page. I can't seem to get the labels, controls, etc. to let me place them where I want them on the page. I found several articles that suggest to make sure document shows in property window then go to page Layout. My page layout on this will not allow me to select this. Any suggestion for how to get controls where I want them on the page?

Dani AI

Generated

For : the core issue is that web pages are laid out by HTML and CSS at runtime, not by dragging controls like a Windows Forms designer. Visual Studio's design surface can help for small mockups, but it does not reliably produce the final layout a browser will render. That is why items do not stay where you expect when you move them in Design view.

is right to point toward learning markup and styles; authoring a page by creating containers and styling them is the stable approach. also correctly noted that the designer can be switched into a mode that forces toolbox-added controls into absolute-positioned elements — useful for quick placement, but brittle for real pages because inline absolute positioning breaks flow, responsiveness, and maintenance.

Practical workflow that avoids designer frustration:

  • Build the page structure in Source (header, nav, main, footer or ASP.NET Panel/PlaceHolder containers).
  • Give containers meaningful CssClass values and write styles in an external stylesheet.
  • Place ASP.NET controls inside those containers and style them via the control's CssClass (not by moving them in Design view).
  • Preview in a browser and use developer tools to inspect the rendered HTML and computed CSS.

Example (minimal):

<div class="layout">
  <asp:Label ID="lblTitle" runat="server" CssClass="title" Text="Page title" />
  <asp:TextBox ID="txtInput" runat="server" CssClass="field" />
</div>

<style>
.layout { max-width: 960px; margin: 0 auto; display: flex; gap: 1rem; }
.title { font-weight: bold; }
.field { flex: 1; }
</style>

Troubleshooting pointers: check for styles coming from a Master Page, theme, or reset stylesheet that override your rules; inspect the runtime HTML (Visual Studio design view can differ); avoid using tables for layout unless the content is tabular; prefer CSS Flexbox/Grid for modern, robust layouts. If absolute positioning is used, limit it to small UI pieces (tooltips, overlays) and not the whole page.

Recommended Answers

All 2 Replies

You do know html and css don't you? If not then you should read some tutorials on them. Do your page base layout, you can use div tags or a table. Then with css add your colors, width, height, and so on. Like if you want a nav bar that stretches 100% of the width you would add a div tag and using css you would set its width to 100%. If under the nav bar you wanted three columns sitting side by side you would add three div tags and in css you would use float to get this effect.
You can use a table and do the samething with colspan and rowspan. Anyway I never use the wiglet to layout a page. It uses fixed sizes and overall does a poor job with the layout.

Hope this help a little.

hallo,

you click on tools menu,
then click on option,
then expand HTML Designer
then check last check box in VS2008
which is change positioning to absolute for controls added using toolbox.....
by check this check box you can simply drag and drop controls in asp.net..
but designing using html link using table, tr, td is good as a designing.

- mitul modi

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.