Look at the code (default .aspx.cs in your case) on the page in question. There you will see your namespace. Aspx is a complement to the class in code, which is combined using a partial class declaration.
I just created a new web application project. It looks like this:
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; namespace WebApplication1 { public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } } }
So you see the namespace "WebApplication1". You see it, right?
ADDED: I again created a website project to test this. Well, I confirm, I don't see any namespace declarations there. After a little search, I found this post:
asp.net - website and web application (link fixed)
The new compilation model threw out the visual studio project project itself, returned asp.net to the concept of "compilation on the fly," but eliminated the use of namespaces on the website and radically changed the way the user interface template and associated code were created.
In appearance, it just throws all the classes together, both page classes and your custom logical classes, which you usually put in the App_Code folder. The viewer class also does not show page objects, even if I transfer them to my own namespaces, but it does it right along with the namespaces for declarations in the App_Code folder. I suppose the guys from the VS team didn't want you to deal with namespaces for page classes.
user151323
source share