Natan,
Could you let me know how you determined that
Those are generated automatically by ASP.NET
when it parses the page and creates the class.
re:
Since the page itself is a class, the page is converted
to a class extending System.Web.UI.Page and compiled.
Not the code behind, but the page. All the HTML you create
is parsed and there is a lot of LiteralControls to hold all the html you write.
Where did you find the list of Imports statements you quoted ?
i.e., I compiled the test you posted, to check it out.
---------------
<%@ Page Language="C#"%>
<script runat="server">
void Page_Load(object sender, EventArgs e)
{
bla;
}
</script>
----------------------
( I added the ";", so it would compile )
You requested that I do this :
------------------------------------------
"Save as .ASPX and run. There will be an error because of the "bla" and
there is a link tho show the "Complete Compilation Source". That is the
ASPX page that is actually compiled.
---------------------------------
I did that and got this list of compiled page resources
in the "Complete Compilation Source" :
System.EnterpriseServices.dll
acme.dll
global.asaxxi3ltqav.dll
System.Web.Services.dll
System.dll
System.Drawing.dll
System.Web.dll
System.Data.dll
mscorlib.dll
System.Web.Mobile.dll
System.Xml.dll
i8fuexe.dll
i8fuexe.0.cs
i8fuexe.1.cs
Then, you said that:
----------------------------
If you specify an Inherits="xxxx" in the Page directive,
what happens is that this class extends yous class.
---------------------------
So, I added
<%@ Import Namespace ="System.Diagnostics" %>
to the page, since you said that would add a namespace
which should have been compiled, if you're right, given that
you said that :
-----------------------------------
"those are namespaces imported by default when ASP.NET
parses your .ASPX page and automatically generates a class
in the ASP namespace to compile.
But the solution has nothing to do with templates or VS.NET.
The only way I see to solve this is with
<%@ Import Namespace="xxx" %> in every page."
--------------------------------------
I, then, added
<%@ Import Namespace ="System.Diagnostics" %>
to satisfy your requisite, as you said to do.
But, the new list of compiled page resources only has :
System.EnterpriseServices.dll
acme.dll
global.asaxxi3ltqav.dll
System.Web.Services.dll
System.dll
System.Drawing.dll
System.Web.dll
System.Data.dll
mscorlib.dll
System.Web.Mobile.dll
System.Xml.dll
7ion-da0.dll
7ion-da0.0.cs
7ion-da0.1.cs
and does *not* have a reference to "System.Diagnostics.dll",
as it should have been added if I understood what you say,
and what you explain is correct, that the "Imports" Page
statement would add the "System.Diagnostics" to the list
of compiled resources.
If I did *not* understand what you said, please detail the method(s)
you used to determine which dll's are included in the compiled aspx page,
and how/when/where another namespace, added via <%@ Import Namespace ="Bla.Bla" %>
to the page, is added to the compiled list of resources for that page.
This will make your position a bit easier to understand.
Please take the time to document this, as I have done.
Don't take offense. Just prove your point.
This is extremely interesting, and I'd like to know
if you are actually right, because it would certainly
change the way I've understood, up until now,
the .NET Framework and ASP.NET's inner workings.
Juan T. Llibre
===========