views:

415

answers:

6

By default, a new ASPX page contains the following:

<body>
    <form id="form1" runat="server">
    <div>


    </div>
    </form>
</body>

I'm curious--is there any reason I should leave that div tag in?

+4  A: 

To put things in it? It's not necessary, but it prevents you from having to create a div tag when starting out your web layout.

TheTXI
It also might go back to the days when they wanted developing web sites to be like windows forms. Where you would *shudders* drag and drop the controls on a page.
David Basarab
@Longhorn213 - that would be my suspicion as I know of people who still drag and drop their interface then position everything absolutely.
Rob Allen
+1  A: 

Why? Because said DIV is part of the template. No, it doesn't matter and you can feel free to get rid of it.

Wyatt Barnett
+5  A: 

There's no real point, but I don't think it's standards-compliant to write text straight after a <form> tag, but it would be inside a <div>. Feel free to delete it though.

Graham Clark
+1  A: 

Maybe they are subtly encouraging designers to shed the <TABLE> mentality and move to <DIV>s. ;-)

Cerebrus
A: 

Can u bit more specific?

+1  A: 

If you don't like it, you can always edit the default template to remove them permanently:

C:\Program Files\Microsoft Visual Studio 9.0\Web\WebNewFileItems\CSharp\WebForm.aspx

C:\Program Files\Microsoft Visual Studio 9.0\Web\WebNewFileItems\VB\WebForm.aspx

Just remove the <div> </div> tags from the relevant one of these for your projects.

Zhaph - Ben Duguid