Changing namespace in ASP.NET Web-Form
When converting VS Web-Site to VS Web application One of the problem you might stumble upon is class name collisions. It is due to the fact that web-site, because of it’s compilation mode, can have the same class name (and no namespace) on different files because they will end up in different assemblies.
On web-application though, it is a different story. All classes ends up in the same assembly
and therefore we have to name them differently. You will encounter this problem when the compiler will say that '<YourPage>' already defines a member called 'Page_Load' or some other method /property/ field while you won’t see it anywhere else on the same file.
So, What do you need to do?
1. Add namespace to the code behind, do so for both aspx.cs and aspx.designer.cs files.
2. On the markup file (.aspx) page directive, change the “Inherits” attribute so it will corresponds to the new type name (<namespace>.<class>).
What not to do?
Do not use the option of overall changing the namespace. It will add namespace to all
classes by the same name and keep your name collisions in tact.
When converting some (not so) good old VS Web Site to VS Web Application you might encounter some class name collision. You can solve this collision by changing
namespaces however you should be very cautious while doing so.