Hello,
Q1 - Asp.Net is able to detect when you change the original files and automatically recompilles the application when next request arrives
A) But it appears that while with Web sites Asp.Net is able to detect changes, regardless of whether they happen in code-behind file (.cs) or in aspx file, with Web projects Asp.Net only detects changes that happen inside aspx file, but it doesn’t detect changes inside .cs files! Why is that?
B) Asp.Net also detects if any new aspx or cs files were added to the website. But, will it upon the next request compile just the added files, or will it recompile all of app’s files?
C) If an application on a web server contains several aspx files, some created by web project ( and thus their code behind files are inside single assembly ) while other aspx files were created via a website project, how is Asp.Net able to figure out whether particular aspx file has code behind contained within an assembly located in Bin directory?
Q2 “Codebehind attribute is used only by the Visual Studio Web Forms Designer. The attribute is not used at run time.”
I assume CodeBehind attribute is not used at runtime due to the fact that all .cs files are compiled into single assembly, and thus VS has no problem locating a class as long as aspx tells the name of the class via Inherits attribute?!
On the other hand, Asp.Net code behind model does need src attribute, because here cs files get compiled into separate assemblies and thus asp.net needs to know the name of the file specified by CodeFile attribute, so it can somehow figure out the name of the assembly into which this file compiled?
thanx