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?
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?
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.
Why? Because said DIV is part of the template. No, it doesn't matter and you can feel free to get rid of it.
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.
Maybe they are subtly encouraging designers to shed the <TABLE>
mentality and move to <DIV>s
. ;-)
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.