Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Moving/Positioning Controls on ASP webforms

  • 19-12-2012 06:29PM
    #1
    Closed Accounts Posts: 8,199 ✭✭✭


    I was messing around earlier with my first attempt at an ASP site. I have Visual Studio and I created an ASP webforms site but I found it quite restrictive. I don't know if I was doing something wrong or hadn't changed some setting, but I found while I could drag and drop controls, moving them or re-positioning them seemed extremely restrictive. Perhaps I'm thinking too much of WinForms where I can move controls around as much as I want, but the ASP webforms option seemed to be very difficult to use.

    Is there something I need to do in order to "free" these controls up to let me re-position and move them around easier? I'm a complete beginner with ASP/ASP.Net.

    Thanks!


Comments

  • Registered Users, Registered Users 2 Posts: 2,062 ✭✭✭Colonel Panic


    First of all, I would suggest not using WinForms, partially because of the problems you are having. An alternative is ASP.Net MVC, which is one of the better web frameworks that I've come across. The problem there is that you will need to know how to lay stuff out with HTML and CSS instead if you take that route.

    And to answer your actual question... I *think* that WebForms has layout containers similar to those in System.Windows.Forms but I might not be remembering correctly.


  • Administrators Posts: 55,406 Admin ✭✭✭✭✭awec


    Using the drag-and-drop method to design pages is going to be restrictive.

    I'd say edit the HTML and CSS directly if you can.


  • Registered Users, Registered Users 2, Paid Member Posts: 817 ✭✭✭tawfeeredux


    Drag & drop is only really for adding elements, such as buttons, labels, textboxes, etc. on to your page. As awec suggests, you should edit the resulting Html and add styling with CSS. Many of the controls will have layout & appearance properties available in the Design view (such as height, width, background colour, borders, etc.), but using CSS gives you more options (positioning with float, margins between elements, padding, display properties).


  • Administrators Posts: 55,406 Admin ✭✭✭✭✭awec


    Drag and drop with winforms is slightly better than webforms too, your visual designer code in winforms doesn't have to be translated to HTML.


Advertisement