Newbie question: Why don't forms act reasonably?

Discussion in 'ASP .Net' started by CedricCicada@gmail.com, Jan 29, 2006.

  1. Guest

    Greetings!

    I am trying to teach myself ASP.Net, using the Visual Studio .Net IDE.
    So far, the hardest thing I've found is trying to edit controls on a
    page. The editor does not seem to act as I have come to expect from
    VB, C#, and FoxPro. For example, I can't drag a rectangle around
    several controls and have all of them be selected. I can't use Ctrl-A
    to select all controls and then right-click and select Run As Server
    Control for all of them; as soon as I right-click, the control I'm on
    becomes the only one selected. It is extremely hard to expand the size
    of a form. The only way I've found is to select several controls and
    drag them down. As the bottom of the select falls off the bottom of the
    form, the form is expanded to compensate. There's got to be a better
    way than that. Is there some setting I can use to get forms to behave?

    Is there a better form for complete newbies at ASP.Net?

    Thank you very much!

    RobR
    , Jan 29, 2006
    #1
    1. Advertising

  2. Well, there are two things that I think I need to point out to you here:

    1. Keep in mind that you are creating something that will be used as an
    application that generates web pages. ASP.NET generates web pages that use
    HTML, Javascript, and CSS. Because these technologies do not use a
    fixed-size page (the width/height depends on the size of the user's browser
    window, the content of the page, and sometimes various CSS properties), each
    Control is placed after the previous control (or tag such as a <BR> or
    content such as &nbsp;). If you prefer (although it is not usually
    recommended) you can work in GridLayout mode by doing one of the following:

    1. Add the following attribute to the BODY tag: MS_POSITIONING="GridLayout"

    OR

    2. Select the DOCUMENT (by clicking somewhere other than a Control). In the
    Properties list, set pageLayout to GridLayout (this will add the attribute
    mentioned above).

    Working in GridLayout mode basically allows you to use absolute positioning
    using CSS properties by dragging the Controls around. But once again, I do
    not recommend it for several reasons:

    1. It increases the file size by adding extra CSS to every Control
    2. It makes it harder to design pages that will look good on all screen
    sizes (extra white space on larger monitors, extra scrolling on smaller
    monitors)
    3. It makes maintaining pages harder (if you change the size of a Control by
    adding/removing text, changing height/width, or adding/removing a Control,
    you must manually adjust the position of all controls after that Control)
    4. Once you start creating custom user controls (it sounds hard, but it
    isn't, and they are important to know how to use), you will be forced to use
    FlowLayout because custom user controls do not support GridLayout
    5. It is good to work in the same mindset as the browser when designing a
    page, it makes it easier to know what to expect

    I think the reason you are having trouble adjusting to Visual Studio .NET's
    ASP.NET IDE is because it sounds like you have been using Visual Studio to
    create applications for Windows. Windows generally uses a GridLayout-style
    form (it might have a different name in Windows Forms). You need to realize
    the difference in interfaces between Windows Applications and Web
    Applications. Hopefully this helps, Good Luck!
    --
    Nathan Sokalski

    http://www.nathansokalski.com/

    <> wrote in message
    news:...
    > Greetings!
    >
    > I am trying to teach myself ASP.Net, using the Visual Studio .Net IDE.
    > So far, the hardest thing I've found is trying to edit controls on a
    > page. The editor does not seem to act as I have come to expect from
    > VB, C#, and FoxPro. For example, I can't drag a rectangle around
    > several controls and have all of them be selected. I can't use Ctrl-A
    > to select all controls and then right-click and select Run As Server
    > Control for all of them; as soon as I right-click, the control I'm on
    > becomes the only one selected. It is extremely hard to expand the size
    > of a form. The only way I've found is to select several controls and
    > drag them down. As the bottom of the select falls off the bottom of the
    > form, the form is expanded to compensate. There's got to be a better
    > way than that. Is there some setting I can use to get forms to behave?
    >
    > Is there a better form for complete newbies at ASP.Net?
    >
    > Thank you very much!
    >
    > RobR
    >
    Nathan Sokalski, Jan 29, 2006
    #2
    1. Advertising

  3. Guest

    Re: Newbie question: Why don't forms act reasonably?

    Nathan,

    Thanks very much for your reply. I am sure you are correct.

    Rob
    , Jan 29, 2006
    #3
  4. Re: Newbie question: Why don't forms act reasonably?

    On 28 Jan 2006 19:17:12 -0800, wrote:

    >Nathan,
    >
    >Thanks very much for your reply. I am sure you are correct.
    >
    >Rob

    In addition to using the Grid layout mode when creating pages (I agree
    with Nathan; not recommended) you can put the controls in a table that
    arranges them IN RELATION to one another, but not always in the exact
    spot on the page.

    If you want to see an example of this, go to just about any web page
    on the Internet and view the source. You will see many instances of
    input controls, etc. placed between the tags <td> and </td> these two
    tags are delimiters for cells in a table.

    Here is an example showing a row <tr></tr> and a cell <td></td>
    containing an ASP:TextBox control

    <tr>
    <td align="left" colspan="2"><ASP:TEXTBOX id="txtCall"
    runat="server" width="216"></ASP:TEXTBOX></td>
    </tr>

    Good luck,

    Otis Mukinfus
    http://www.otismukinfus.com
    http://www.tomchilders.com
    Otis Mukinfus, Jan 29, 2006
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. jlopes151
    Replies:
    2
    Views:
    601
    Steve C. Orr [MVP, MCSD]
    Mar 14, 2005
  2. Roedy Green

    Class.forName reasonably efficient

    Roedy Green, Jan 14, 2006, in forum: Java
    Replies:
    4
    Views:
    448
    Dave Glasser
    Jan 15, 2006
  3. Larry goodman

    reasonably priced reporting solution

    Larry goodman, Oct 15, 2003, in forum: Python
    Replies:
    5
    Views:
    349
    Larry goodman
    Oct 16, 2003
  4. Mr. SweatyFinger
    Replies:
    2
    Views:
    1,736
    Smokey Grindel
    Dec 2, 2006
  5. Bruno Desthuilliers
    Replies:
    5
    Views:
    369
    Bruno Desthuilliers
    Aug 29, 2007
Loading...

Share This Page