Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

Where to put Form tag

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
tshad - 30 Jul 2007 19:48 GMT
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
Peter Bucher [MVP] - 30 Jul 2007 20:22 GMT
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>
[...]

Signature

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 - 30 Jul 2007 22:34 GMT
That was what I figured,

Thanks,

Tom
> Hi Tom
>
[quoted text clipped - 11 lines]
> </body>
> [...]
Steve C. Orr [MCSD, MVP, CSM, ASP Insider] - 30 Jul 2007 22:09 GMT
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.

Signature

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

>I have pages that are identical except for the middle of the page to the
>right where I do all my work.
[quoted text clipped - 39 lines]
>
> Tom
tshad - 30 Jul 2007 22:37 GMT
> 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 have pages that are identical except for the middle of the page to the
>>right where I do all my work.
[quoted text clipped - 39 lines]
>>
>> Tom

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.