Namespace Import In Html.....Why?

L

Learnicus

Hello

I used to think I understood namespaces. In an aspx page I have a line that
reads

<%@ Import Namespace="MyCo.Solutions.MyProd.UI.WebForms" %>

I had this in there because when the code was being developed in VS 2003 I
had each codebehind file explicitly declare itself as part of that namespace
and also emptied/blanked out the option to set the namespace in Project
properties. Now here I am in VS 2005 and ive gone the other way. So i took
the above line out of an aspx page but now that page cannot find global_asax
for the following line of code

<link rel="stylesheet" href="<%= Global_asax.GetApplicationPath()
%>styles/main.css" type="text/css">

I dont understand why the namespace import is still now needed because both
this page and global_asax are in the same namespace as defined by project
properties and as verified when I use the MSIL dissassembler tool. Why do I
need to import a namespace when this page and the functionality I wish to
leverage already belong to that namespace??

Thanks

Lenny
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Staff online

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,162
Latest member
GertrudeMa
Top