Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post May 22, 2009 03:42 PM by aazizorg
May 22, 2009 03:10 PM|LINK
the more i think about it, i dont think that you can use namespaces in code files, since you are using a web site project.
with a web app project, all the code is compiled into an actual .dll library, whereas with a web site, the code is not compiled this way. since with a web app all the code is in one assembly, it can contain things like namespaces, but with a web site, the
code files are just code files, and since they are not in an assembly, they cannot be contained in things like namespaces.
May 22, 2009 03:19 PM|LINK
from what ive been playing around with (i use web apps instead of web sites, so i dont know too much about their differences), it seems that the ASP namespace is an "on-the-fly" namespace. if you have two different pages, and look at the ASP namespace for
each, then you will find that they do not show the same things. by default, it looks as if for each page, their ASP namespace allows access to the current page for which you are working on. then, when you add Reference tags, the controls you reference for
that page become visible only in that pages ASP namespace. (this would explain why earlier, not all of the controls in the directory where you put them were visible in the ASP namespace).
as i said in my previous post, web sites are not compiled into an assembly. This would also mean that your web site project does not actually have a namespace to it.
May 22, 2009 03:22 PM|LINK
Yeah, I've read into the Website-VS-Webapp bit, and see what you mean. Well, I edited my above post, that solution worked. The rules as I understand them:
May 22, 2009 03:40 PM|LINK
The control needs to have a ClassName tag in the <%@ Control %> tag (actually, I think if it doesn't you'll use the generated class name?)
ClassName i believe will only override the name of the class as defined in the code-behind.
May 22, 2009 03:42 PM|LINK
I think I've got a work around for that problem that better suits the situation anyways.
You actually helped me a lot. I didn't know what kind of response I'd get on these forums, but so far looks pretty helpful, I'm glad I posted.