First of all, you should NEVER use any editor not intended for ASP.NET to
edit .aspx files. Editors such as Dreamweaver are HTML editors and do not
know what the directives do, and because they are wysiwyg (visual) editors,
they will usually recreate all the code each time, or at least remove parts
of the code that they do not know what mean. My suggestion is to do one of
the following:
Avoid editors other than the one you use to create your ASP.NET application
(probably Visual Studio .NET)
OR
If you really want to use a graphical HTML editor, create a separate page
using whatever editor you like, and then copy and paste the desired sections
from that code into your .aspx file.
My personal opinion of most graphical HTML editors (including Dreamweaver),
however, is that they are not very good. They often create inefficient and
sometimes unnecessary code. In order to make them create code that is good
enough to be worth using you often need to put in so much effort that it
would be quicker to write it by hand. But even more important, why are you
trying to edit your file in another editor anyway? Only ASP.NET editors will
be able to recognize your webcontrols, so unless you plan on using all HTML
controls in your code, a graphical HTML editor won't be much help. And if
you do plan on using only HTML controls, why are you making it in ASP.NET to
begin with?