Where to put Form tag

Discussion in 'ASP .Net' started by tshad, Jul 30, 2007.

  1. tshad

    tshad Guest

    I have pages that are identical except for the middle of the page to the
    right where I do all my work.

    <html>
    <head>
    </head>
    <body>
    <table>
    <tr>
    <td>
    <table>
    <tr>
    <td>
    <form>
    <asp:...>
    <asp:...>
    ...
    </form
    </td>
    </tr>
    </table>
    </td>
    </tr>
    </table>
    </body>
    </html>

    This works fine.

    But now I need to add an <asp:Label> and maybe an <asp:textbox> just below
    the <body> tag.

    Do I need to move the <form> to just after the <body> and the </form> to
    just before the </body>?

    There is a lot of objects such as images and flash that will now be inside
    the forms tag.

    Is this going to be a problem? Will it slow the page down doing this?

    Thanks,

    Tom
     
    tshad, Jul 30, 2007
    #1
    1. Advertising

  2. Hi Tom

    > Do I need to move the <form> to just after the <body> and the </form> to
    > just before the </body>?

    Yes, as the autogenerated Site looks like in Visual Studio.
    The whole Event System with the serverside controls build on the form
    and needs them around.

    [...]
    <body>
    <form....>
    [All other Content goes here]
    </form>
    </body>
    [...]

    --
    Gruss, Peter Bucher
    Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
    http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
    http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET
     
    Peter Bucher [MVP], Jul 30, 2007
    #2
    1. Advertising

  3. Yes, you should adjust the form tags as you specified.
    It's ok that a lot of other stuff will be in the form tags. If these
    elements are not marked as runat="server" then they will have no effect on
    performance.

    --
    I hope this helps,
    Steve C. Orr,
    MCSD, MVP, CSM, ASPInsider
    http://SteveOrr.net


    "tshad" <> wrote in message
    news:%...
    >I have pages that are identical except for the middle of the page to the
    >right where I do all my work.
    >
    > <html>
    > <head>
    > </head>
    > <body>
    > <table>
    > <tr>
    > <td>
    > <table>
    > <tr>
    > <td>
    > <form>
    > <asp:...>
    > <asp:...>
    > ...
    > </form
    > </td>
    > </tr>
    > </table>
    > </td>
    > </tr>
    > </table>
    > </body>
    > </html>
    >
    > This works fine.
    >
    > But now I need to add an <asp:Label> and maybe an <asp:textbox> just below
    > the <body> tag.
    >
    > Do I need to move the <form> to just after the <body> and the </form> to
    > just before the </body>?
    >
    > There is a lot of objects such as images and flash that will now be inside
    > the forms tag.
    >
    > Is this going to be a problem? Will it slow the page down doing this?
    >
    > Thanks,
    >
    > Tom
    >
     
    Steve C. Orr [MCSD, MVP, CSM, ASP Insider], Jul 30, 2007
    #3
  4. tshad

    tshad Guest

    That was what I figured,

    Thanks,

    Tom
    "Peter Bucher [MVP]" <> wrote in message
    news:...
    > Hi Tom
    >
    >> Do I need to move the <form> to just after the <body> and the </form> to
    >> just before the </body>?

    > Yes, as the autogenerated Site looks like in Visual Studio.
    > The whole Event System with the serverside controls build on the form
    > and needs them around.
    >
    > [...]
    > <body>
    > <form....>
    > [All other Content goes here]
    > </form>
    > </body>
    > [...]
    >
    > --
    > Gruss, Peter Bucher
    > Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
    > http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
    > http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET
     
    tshad, Jul 30, 2007
    #4
  5. tshad

    tshad Guest

    "Steve C. Orr [MCSD, MVP, CSM, ASP Insider]" <> wrote in
    message news:...
    > Yes, you should adjust the form tags as you specified.
    > It's ok that a lot of other stuff will be in the form tags. If these
    > elements are not marked as runat="server" then they will have no effect on
    > performance.
    >


    That makes sense.

    I was always used to building my look and feel first and then started
    putting my <form> tag around the area where my asp objects were which as
    usually a cell in a table.

    If there is no drawback that putting the form right after the body makes
    more sense as it doesn't matter where on the page that I put some object
    that may be outside of my normal work area.

    Thanks,

    Tom
    > --
    > I hope this helps,
    > Steve C. Orr,
    > MCSD, MVP, CSM, ASPInsider
    > http://SteveOrr.net
    >
    >
    > "tshad" <> wrote in message
    > news:%...
    >>I have pages that are identical except for the middle of the page to the
    >>right where I do all my work.
    >>
    >> <html>
    >> <head>
    >> </head>
    >> <body>
    >> <table>
    >> <tr>
    >> <td>
    >> <table>
    >> <tr>
    >> <td>
    >> <form>
    >> <asp:...>
    >> <asp:...>
    >> ...
    >> </form
    >> </td>
    >> </tr>
    >> </table>
    >> </td>
    >> </tr>
    >> </table>
    >> </body>
    >> </html>
    >>
    >> This works fine.
    >>
    >> But now I need to add an <asp:Label> and maybe an <asp:textbox> just
    >> below the <body> tag.
    >>
    >> Do I need to move the <form> to just after the <body> and the </form> to
    >> just before the </body>?
    >>
    >> There is a lot of objects such as images and flash that will now be
    >> inside the forms tag.
    >>
    >> Is this going to be a problem? Will it slow the page down doing this?
    >>
    >> Thanks,
    >>
    >> Tom
    >>

    >
     
    tshad, Jul 30, 2007
    #5
    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. RC
    Replies:
    2
    Views:
    446
    Malte
    May 10, 2005
  2. shruds
    Replies:
    1
    Views:
    872
    John C. Bollinger
    Jan 27, 2006
  3. RC
    Replies:
    2
    Views:
    668
  4. André
    Replies:
    2
    Views:
    762
    André
    Jun 23, 2008
  5. Eqbal Z
    Replies:
    6
    Views:
    193
    Eqbal Z
    Aug 27, 2003
Loading...

Share This Page